Use FastAlloc for Packet, Request, CoherenceState, and SenderState so we don't spend so much time calling malloc()

--HG--
extra : convert_revision : a946564eee46ed7d2aed41c32d488ca7f036c32f
This commit is contained in:
Ali Saidi 2007-06-21 13:50:35 -04:00
parent 77aa98d0f8
commit 5195500cdf
2 changed files with 8 additions and 4 deletions

View file

@ -43,6 +43,7 @@
#include <bitset> #include <bitset>
#include "base/compiler.hh" #include "base/compiler.hh"
#include "base/fast_alloc.hh"
#include "base/misc.hh" #include "base/misc.hh"
#include "mem/request.hh" #include "mem/request.hh"
#include "sim/host.hh" #include "sim/host.hh"
@ -182,7 +183,7 @@ class MemCmd
* ultimate destination and back, possibly being conveyed by several * ultimate destination and back, possibly being conveyed by several
* different Packets along the way.) * different Packets along the way.)
*/ */
class Packet class Packet : public FastAlloc
{ {
public: public:
@ -257,7 +258,7 @@ class Packet
/** A virtual base opaque structure used to hold coherence-related /** A virtual base opaque structure used to hold coherence-related
* state. A specific subclass would be derived from this to * state. A specific subclass would be derived from this to
* carry state specific to a particular coherence protocol. */ * carry state specific to a particular coherence protocol. */
class CoherenceState { class CoherenceState : public FastAlloc {
public: public:
virtual ~CoherenceState() {} virtual ~CoherenceState() {}
}; };
@ -274,7 +275,7 @@ class Packet
* needed to process it. A specific subclass would be derived * needed to process it. A specific subclass would be derived
* from this to carry state specific to a particular sending * from this to carry state specific to a particular sending
* device. */ * device. */
class SenderState { class SenderState : public FastAlloc {
public: public:
virtual ~SenderState() {} virtual ~SenderState() {}
}; };

View file

@ -39,6 +39,7 @@
#ifndef __MEM_REQUEST_HH__ #ifndef __MEM_REQUEST_HH__
#define __MEM_REQUEST_HH__ #define __MEM_REQUEST_HH__
#include "base/fast_alloc.hh"
#include "sim/host.hh" #include "sim/host.hh"
#include "sim/core.hh" #include "sim/core.hh"
@ -76,7 +77,7 @@ const uint32_t MEM_SWAP = 0x100000;
const uint32_t MEM_SWAP_COND = 0x200000; const uint32_t MEM_SWAP_COND = 0x200000;
class Request class Request : public FastAlloc
{ {
private: private:
/** /**
@ -153,6 +154,8 @@ class Request
setVirt(_asid, _vaddr, _size, _flags, _pc); setVirt(_asid, _vaddr, _size, _flags, _pc);
} }
~Request() {} // for FastAlloc
/** /**
* Set up CPU and thread numbers. */ * Set up CPU and thread numbers. */
void setThreadContext(int _cpuNum, int _threadNum) void setThreadContext(int _cpuNum, int _threadNum)