diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:43 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:43 -0500 |
commit | 41846cb61b0f511099eb9a203f11885de328ab45 (patch) | |
tree | 7563b309ba914ea57dd12e6cfba3ea33817ab1b1 /src/cpu/testers/directedtest | |
parent | 5df96cb690168d750ab0fafffd11fb51624374d2 (diff) | |
download | gem5-41846cb61b0f511099eb9a203f11885de328ab45.tar.xz |
mem: Assume all dynamic packet data is array allocated
This patch simplifies how we deal with dynamically allocated data in
the packet, always assuming that it is array allocated, and hence
should be array deallocated (delete[] as opposed to delete). The only
uses of dataDynamic was in the Ruby testers.
The ARRAY_DATA flag in the packet is removed accordingly. No
defragmentation of the flags is done at this point, leaving a gap in
the bit masks.
As the last part the patch, it renames dataDynamicArray to dataDynamic.
Diffstat (limited to 'src/cpu/testers/directedtest')
-rw-r--r-- | src/cpu/testers/directedtest/InvalidateGenerator.cc | 4 | ||||
-rw-r--r-- | src/cpu/testers/directedtest/SeriesRequestGenerator.cc | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/cpu/testers/directedtest/InvalidateGenerator.cc b/src/cpu/testers/directedtest/InvalidateGenerator.cc index 84a90844f..61c3f5972 100644 --- a/src/cpu/testers/directedtest/InvalidateGenerator.cc +++ b/src/cpu/testers/directedtest/InvalidateGenerator.cc @@ -76,9 +76,7 @@ InvalidateGenerator::initiate() } else { panic("initiate was unexpectedly called\n"); } - uint8_t* dummyData = new uint8_t; - *dummyData = 0; - pkt->dataDynamic(dummyData); + pkt->allocate(); if (port->sendTimingReq(pkt)) { DPRINTF(DirectedTest, "initiating request - successful\n"); diff --git a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc index 80523280b..2356fb47a 100644 --- a/src/cpu/testers/directedtest/SeriesRequestGenerator.cc +++ b/src/cpu/testers/directedtest/SeriesRequestGenerator.cc @@ -69,9 +69,7 @@ SeriesRequestGenerator::initiate() } PacketPtr pkt = new Packet(req, cmd); - uint8_t* dummyData = new uint8_t; - *dummyData = 0; - pkt->dataDynamic(dummyData); + pkt->allocate(); if (port->sendTimingReq(pkt)) { DPRINTF(DirectedTest, "initiating request - successful\n"); |