{
PacketPtr pkt;
buildPacket(pkt, req, read);
- pkt->dataDynamic<uint8_t>(data);
+ pkt->dataDynamicArray<uint8_t>(data);
if (req->getFlags().isSet(Request::NO_ACCESS)) {
assert(!dcache_pkt);
pkt->makeResponse();
PacketPtr pkt = new Packet(req, pkt1->cmd.responseCommand(),
Packet::Broadcast);
- pkt->dataDynamic<uint8_t>(data);
+ pkt->dataDynamicArray<uint8_t>(data);
pkt1->dataStatic<uint8_t>(data);
pkt2->dataStatic<uint8_t>(data + req1->getSize());
if (traceData) {
traceData->setData(data);
}
- T *dataP = new T;
+ T *dataP = (T*) new uint8_t[sizeof(T)];
*dataP = TheISA::htog(data);
return writeTheseBytes((uint8_t *)dataP, sizeof(T), addr, flags, res);
if (state->isPrefetch()) {
state->setNoFault();
}
- delete state->data;
+ delete [] state->data;
state->deleteReqs();
translationFault(state->getFault());
} else {
void
setData(uint8_t *p)
{
- std::memcpy(getPtr<uint8_t>(), p, getSize());
+ if (p != getPtr<uint8_t>())
+ std::memcpy(getPtr<uint8_t>(), p, getSize());
}
/**