mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
commit
e23d569076
1 changed files with 12 additions and 12 deletions
|
@ -168,23 +168,23 @@ public:
|
|||
{}
|
||||
|
||||
void* operator new(size_t /*size*/) {
|
||||
return allocator().allocate();
|
||||
return allocator_.allocate();
|
||||
}
|
||||
|
||||
void operator delete(void* ptr) {
|
||||
allocator().deallocate(ptr);
|
||||
allocator_.deallocate(ptr);
|
||||
}
|
||||
|
||||
protected:
|
||||
Func func_;
|
||||
Pkt pkt_;
|
||||
|
||||
static MemoryPool<SimCallEvent<Pkt>>& allocator() {
|
||||
static MemoryPool<SimCallEvent<Pkt>> instance(64);
|
||||
return instance;
|
||||
}
|
||||
static MemoryPool<SimCallEvent<Pkt>> allocator_;
|
||||
};
|
||||
|
||||
template <typename Pkt>
|
||||
MemoryPool<SimCallEvent<Pkt>> SimCallEvent<Pkt>::allocator_(64);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <typename Pkt>
|
||||
|
@ -201,23 +201,23 @@ public:
|
|||
{}
|
||||
|
||||
void* operator new(size_t /*size*/) {
|
||||
return allocator().allocate();
|
||||
return allocator_.allocate();
|
||||
}
|
||||
|
||||
void operator delete(void* ptr) {
|
||||
allocator().deallocate(ptr);
|
||||
allocator_.deallocate(ptr);
|
||||
}
|
||||
|
||||
protected:
|
||||
const SimPort<Pkt>* port_;
|
||||
Pkt pkt_;
|
||||
|
||||
static MemoryPool<SimPortEvent<Pkt>>& allocator() {
|
||||
static MemoryPool<SimPortEvent<Pkt>> instance(64);
|
||||
return instance;
|
||||
}
|
||||
static MemoryPool<SimPortEvent<Pkt>> allocator_;
|
||||
};
|
||||
|
||||
template <typename Pkt>
|
||||
MemoryPool<SimPortEvent<Pkt>> SimPortEvent<Pkt>::allocator_(64);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class SimContext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue