packet.hh (4874:cdae9adbd276) | packet.hh (4887:a784c507ea84) |
---|---|
1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 354 unchanged lines hidden (view full) --- 363 data(NULL), staticData(false), dynamicData(false), arrayData(false), 364 addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize), dest(_dest), 365 addrSizeValid(_req->validPaddr), srcValid(false), destValid(true), 366 flags(0), time(curTick), senderState(NULL) 367 { 368 } 369 370 /** Alternate constructor for copying a packet. Copy all fields | 1/* 2 * Copyright (c) 2006 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 354 unchanged lines hidden (view full) --- 363 data(NULL), staticData(false), dynamicData(false), arrayData(false), 364 addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize), dest(_dest), 365 addrSizeValid(_req->validPaddr), srcValid(false), destValid(true), 366 flags(0), time(curTick), senderState(NULL) 367 { 368 } 369 370 /** Alternate constructor for copying a packet. Copy all fields |
371 * *except* set data allocation as static... even if the original 372 * packet's data was dynamic, we don't want to free it when the 373 * new packet is deallocated. Note that if original packet used 374 * dynamic data, user must guarantee that the new packet's 375 * lifetime is less than that of the original packet. */ | 371 * *except* if the original packet's data was dynamic, don't copy 372 * that, as we can't guarantee that the new packet's lifetime is 373 * less than that of the original packet. In this case the new 374 * packet should allocate its own data. */ |
376 Packet(Packet *origPkt) 377 : cmd(origPkt->cmd), req(origPkt->req), | 375 Packet(Packet *origPkt) 376 : cmd(origPkt->cmd), req(origPkt->req), |
378 data(NULL), staticData(false), dynamicData(false), arrayData(false), | 377 data(origPkt->staticData ? origPkt->data : NULL), 378 staticData(origPkt->staticData), 379 dynamicData(false), arrayData(false), |
379 addr(origPkt->addr), size(origPkt->size), 380 src(origPkt->src), dest(origPkt->dest), 381 addrSizeValid(origPkt->addrSizeValid), 382 srcValid(origPkt->srcValid), destValid(origPkt->destValid), 383 flags(origPkt->flags), 384 time(curTick), senderState(origPkt->senderState) 385 { 386 } --- 193 unchanged lines hidden --- | 380 addr(origPkt->addr), size(origPkt->size), 381 src(origPkt->src), dest(origPkt->dest), 382 addrSizeValid(origPkt->addrSizeValid), 383 srcValid(origPkt->srcValid), destValid(origPkt->destValid), 384 flags(origPkt->flags), 385 time(curTick), senderState(origPkt->senderState) 386 { 387 } --- 193 unchanged lines hidden --- |