mem: Assume all dynamic packet data is array allocated
Review Request #2494 - Created Nov. 16, 2014 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10567:4b6d25498f4b --------------------------- 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, and these are now changed to use Packet::allocate or dataDynamicArray as appropriate. 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. Going forward I would suggest a name change to better reflect the semantics, perhaps: dataStatic -> dataNoFree dataDynamic -> dataToFree
Ship It!
Posted (Nov. 29, 2014, 12:52 p.m.)
Since the static/dynamic distinction also impacts the semantics on copies, I think renaming to dataNoFree/dataToFree is overly simplistic. Since there's no distinction between array and non-array dynamic data, though, I suggest keeping the dataDynamic() name rather than the dataDyanamicArray() name (even though the retained semantics matches the latter).
Review request changed
Updated (Nov. 30, 2014, 1:24 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+21 -42) |
Ship It!
