2 #ifndef _CDEBUGMEMORYMANAGER
3 #define _CDEBUGMEMORYMANAGER
4 #include "libMRML/include/uses-declarations.h"
29 #include "libMRML/include/CMutex.h"
30 typedef long CDebuggingMemoryManagerSize;
33 #define MEMSIZE 20000000
59 CDebuggingMemoryManagerSize
mSize;
107 void*
getMem(CDebuggingMemoryManagerSize inSize);
lTChunk * mPrev
Previous Item in List.
Definition: CDebuggingMemoryManager.h:44
friend ostream & operator<<(ostream &outStream, const CDebuggingMemoryManager &inMem)
Output for diagnosis.
Class for memory management: This class gives you the full control about 1MByte of Memory...
Definition: CDebuggingMemoryManager.h:75
CDebuggingMemoryManagerSize mSize
Size of this Chunk.
Definition: CDebuggingMemoryManager.h:59
lTChunk * mPreceding
Previous Item in MEMORY.
Definition: CDebuggingMemoryManager.h:50
lTChunk * mUsedList
List of used memory chunks.
Definition: CDebuggingMemoryManager.h:85
lTChunk * mFreeList
List of free memory chunks.
Definition: CDebuggingMemoryManager.h:83
A structure, which is useful to maintain a twice connected list: A list of Chunks and a list of free/...
Definition: CDebuggingMemoryManager.h:41
bool freeMem(void *)
Deleting Mem.
const long cUnMagic
The magic number to invalidate lTChunk nodes.
Definition: CDebuggingMemoryManager.h:93
const long cMagic
The magic number for valid lTChunk nodes.
Definition: CDebuggingMemoryManager.h:91
lTChunk * mNext
Following Item in List.
Definition: CDebuggingMemoryManager.h:47
long mMagic
We will add to this some stuff to check if the end of this has been overwritten.
Definition: CDebuggingMemoryManager.h:67
void FreeChunk(lTChunk *inChunk)
Marking a Chunk as free and deleting him from the list whose member it presently is.
This class offers an abstraction from the locking method used.
Definition: CMutex.h:40
CDebuggingMemoryManager(const CDebuggingMemoryManagerSize inSize)
Constructor.
lTChunk * mFollowing
Following Item in MEMORY.
Definition: CDebuggingMemoryManager.h:53
CMutex mMutex
for multithreading
Definition: CDebuggingMemoryManager.h:98
void * getMem(CDebuggingMemoryManagerSize inSize)
Getting Mem.
lTChunk * mBuffer
THE memory used by this memory administrator.
Definition: CDebuggingMemoryManager.h:88