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