LReentrantMemoryPool is a PowerPlant class that is areentrant
memory manager for use by interrupt callbacks. Based on the NEWMODE_FAST implementation of operator new.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Source files:
See also:
Purpose:
The constructor creates the object, specifying the initial size of the memory pool.
IMPORTANT: MUST NOT BE CALLED AT INTERRUPT TIME!
Access :
Prototype :
LReentrantMemoryPool (UInt32 inInitialSize);
LReentrantMemoryPool(); // do not use
LReentrantMemoryPool(LReentrantMemoryPool&);Parameters:
The parameters for this constructor are:
| UInt32 | inInitialSize | The initial size of the pool. |
Purpose:
The destructor destroys the object.
Access :
Prototype:
virtual ~LReentrantMemoryPool();
Purpose:
Access :
Prototype:
void AddPool (UInt32 inPoolSize);Parameters:
The parameters for this method are:
| UInt32 | inPoolSize | The size of the pool. |
Return:
Purpose:
Allocate memory from the pool.
Access :
Prototype:
void* AllocFrom (SFreeBlockInfo* inBlockInfo,
UInt32 inByteCount); The parameters for this method are:
| SFreeBlockInfo* | inBlockInfo | The block information. |
| UInt32 | inByteCount | The number of bytes. |
Return:
Purpose:
Free a non-relocatable block from this memory pool. May be called at interrupt time.
Access :
Prototype:
void DisposePtr (void* inPtr);Parameters:
The parameters for this method are:
| void* | inPtr | The pointer. |
Return:
Purpose:
Return the total amount of free memory in this memory pool. May be called at interrupt time.
Access :
Prototype:
UInt32 FreeMem (void);Parameters:
Return:
The amount of free memory in the pool.
Purpose:
Return the size of the non-relocatable block at inPtr. NOTE: The size will be rounded up to the nearest multiple of 4. May be called at interrupt time.
Access :
Prototype:
UInt32 GetPtrSize (void* inPtr);Parameters:
The parameters for this method are:
| void* | inPtr | The pointer. |
Return:
Purpose:
Access :
Prototype:
void MakeFreeBlock (void* inBlock,
UInt32 inByteCount); The parameters for this method are:
| void* | inBlock | The pointer. |
| UInt32 | inByteCount | The byte count. |
Return:
Purpose:
Allocate a new non-relocatable block within the reentrant memory pool. May be called at interrupt time.
Access :
Prototype:
void* NewPtr (UInt32 inByteCount);Parameters:
The parameters for this method are:
| UInt32 | inByteCount | The byte count. |
Return:
Purpose:
Allocate a new non-relocatable block and clear it. May be called at interrupt time.
Access :
Prototype:
void* NewPtrClear (UInt32 inByteCount);Parameters:
The parameters for this method are:
| UInt32 | inByteCount | The byte count. |
Return:
Purpose:
Return the total amount of memory used by this memory pool. May be called at interrupt time.
Access :
Prototype:
UInt32 TotalMem (void);Parameters:
Return:
Purpose:
Access :
Prototype:
LInterruptSafeList mMemoryPools;
Purpose:
Access :
Prototype:
LInterruptSafeList mFreeBlocks;