KaliVeda
Toolkit for HIC analysis
KVMemoryPool.h
1 
4 #ifndef __KVMEMORYPOOL_H
5 #define __KVMEMORYPOOL_H
6 
7 #include "KVMemoryChunk.h"
8 
15 class KVMemoryPool {
19  size_t fChunkSize;
20 
21 public:
22  KVMemoryPool(int nchunks, size_t bytes);
23  virtual ~KVMemoryPool();
24 
25  void* GetMemory(size_t bytes);
26 
27  void Print();
28 
29  ClassDef(KVMemoryPool, 0) //Memory pool
30 };
31 
32 #endif
#define ClassDef(name, id)
Memory handled by KVMemoryPool.
Definition: KVMemoryChunk.h:15
Managed pool of memory.
Definition: KVMemoryPool.h:15
void * GetMemory(size_t bytes)
return pointer to memory of size 'bytes'
size_t fChunkSize
size of chunks in bytes
Definition: KVMemoryPool.h:19
KVMemoryChunk * fLastChunkUsed
Definition: KVMemoryPool.h:18
virtual ~KVMemoryPool()
Destructor.
KVMemoryChunk * fLast
first chunk in pool
Definition: KVMemoryPool.h:17
KVMemoryPool(int nchunks, size_t bytes)
Create nchunks chunks each of size 'bytes'.
KVMemoryChunk * fFirst
first chunk in pool
Definition: KVMemoryPool.h:16