// write. For reads, we have no data yet, so it doesn't make sense to
// allocate.
pkt_data.reset(new uint8_t[size]);
- memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);
+ pkt->writeData(pkt_data.get());
}
// If a cache miss is served by a cache, a monitor near the memory
// a read. For writes, we have already given the MemChecker the data on
// the request, so it doesn't make sense to allocate on write.
pkt_data.reset(new uint8_t[size]);
- memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);
+ pkt->writeData(pkt_data.get());
}
if (is_read || is_write) {