diff options
author | Ron Dreslinski <rdreslin@umich.edu> | 2006-06-30 11:34:27 -0400 |
---|---|---|
committer | Ron Dreslinski <rdreslin@umich.edu> | 2006-06-30 11:34:27 -0400 |
commit | dea1a19b2de2fe031f714904c5247cf27b363237 (patch) | |
tree | 52940bed2d35aa2c94656abaff0d615308fa1eb3 /src/mem/cache/miss | |
parent | 971bb55369a53630349aeb5887cb20599d4396ee (diff) | |
download | gem5-dea1a19b2de2fe031f714904c5247cf27b363237.tar.xz |
Fix the packet data allocation methods. Small fixes from changesets after my initial work.
This now compiles.
src/mem/cache/base_cache.cc:
Fix getPort function that changed
src/mem/cache/base_cache.hh:
Fix get port function, provide default implementations of virtual functions in the base class
src/mem/cache/cache.hh:
Fix virtual function declerations
src/mem/cache/cache_builder.cc:
Fix params
src/mem/cache/cache_impl.hh:
src/mem/cache/miss/blocking_buffer.cc:
src/mem/cache/miss/miss_queue.cc:
src/mem/cache/miss/mshr.cc:
src/mem/cache/prefetch/base_prefetcher.cc:
src/mem/cache/tags/iic.cc:
src/mem/cache/tags/lru.cc:
Properly allocate data in packet
--HG--
extra : convert_revision : dedf8b0f76ab90b06b60f8fe079c0ae361f91a48
Diffstat (limited to 'src/mem/cache/miss')
-rw-r--r-- | src/mem/cache/miss/blocking_buffer.cc | 3 | ||||
-rw-r--r-- | src/mem/cache/miss/miss_queue.cc | 3 | ||||
-rw-r--r-- | src/mem/cache/miss/mshr.cc | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/mem/cache/miss/blocking_buffer.cc b/src/mem/cache/miss/blocking_buffer.cc index d745cb8c6..10d53b109 100644 --- a/src/mem/cache/miss/blocking_buffer.cc +++ b/src/mem/cache/miss/blocking_buffer.cc @@ -210,8 +210,7 @@ BlockingBuffer::doWriteback(Addr addr, int asid, // Generate request Request * req = new Request(addr, size, 0); Packet * pkt = new Packet(req, Packet::Writeback, -1); - uint8_t *new_data = new uint8_t[size]; - pkt->dataDynamicArray<uint8_t>(new_data); + pkt->allocate(); if (data) { memcpy(pkt->getPtr<uint8_t>(), data, size); } diff --git a/src/mem/cache/miss/miss_queue.cc b/src/mem/cache/miss/miss_queue.cc index 34290351d..99ebab017 100644 --- a/src/mem/cache/miss/miss_queue.cc +++ b/src/mem/cache/miss/miss_queue.cc @@ -714,8 +714,7 @@ MissQueue::doWriteback(Addr addr, int asid, // Generate request Request * req = new Request(addr, size, 0); Packet * pkt = new Packet(req, Packet::Writeback, -1); - uint8_t *new_data = new uint8_t[size]; - pkt->dataDynamicArray<uint8_t>(new_data); + pkt->allocate(); if (data) { memcpy(pkt->getPtr<uint8_t>(), data, size); } diff --git a/src/mem/cache/miss/mshr.cc b/src/mem/cache/miss/mshr.cc index fe8cbeea4..05a2fe1c5 100644 --- a/src/mem/cache/miss/mshr.cc +++ b/src/mem/cache/miss/mshr.cc @@ -90,8 +90,7 @@ MSHR::allocateAsBuffer(Packet * &target) asid = target->req->getAsid(); threadNum = target->req->getThreadNum(); pkt = new Packet(target->req, target->cmd, -1); - uint8_t *new_data = new uint8_t[target->getSize()]; - pkt->dataDynamicArray<uint8_t>(new_data); + pkt->allocate(); pkt->senderState = (Packet::SenderState*)this; pkt->time = curTick; } |