#include <oscl_mem_mempool.h>
Inheritance diagram for OsclMemPoolFixedChunkAllocator:
Public Methods | |
OSCL_IMPORT_REF | OsclMemPoolFixedChunkAllocator (const uint32 numchunk=1, const uint32 chunksize=0, Oscl_DefAlloc *gen_alloc=NULL) |
virtual OSCL_IMPORT_REF void | enablenullpointerreturn () |
virtual OSCL_IMPORT_REF | ~OsclMemPoolFixedChunkAllocator () |
virtual OSCL_IMPORT_REF OsclAny * | allocate (const uint32 n) |
virtual OSCL_IMPORT_REF void | deallocate (OsclAny *p) |
virtual OSCL_IMPORT_REF void | notifyfreechunkavailable (OsclMemPoolFixedChunkAllocatorObserver &obs, OsclAny *aContextData=NULL) |
virtual OSCL_IMPORT_REF void | CancelFreeChunkAvailableCallback () |
OSCL_IMPORT_REF void | addRef () |
OSCL_IMPORT_REF void | removeRef () |
Protected Methods | |
virtual OSCL_IMPORT_REF void | createmempool () |
virtual OSCL_IMPORT_REF void | destroymempool () |
Protected Attributes | |
uint32 | iNumChunk |
uint32 | iChunkSize |
uint32 | iChunkSizeMemAligned |
Oscl_DefAlloc * | iMemPoolAllocator |
OsclAny * | iMemPool |
Oscl_Vector< OsclAny *, OsclMemAllocator > | iFreeMemChunkList |
bool | iCheckNextAvailableFreeChunk |
OsclMemPoolFixedChunkAllocatorObserver * | iObserver |
OsclAny * | iNextAvailableContextData |
int32 | iRefCount |
bool | iEnableNullPtrReturn |
|
This API throws an exception when the memory allocation for pool fails If numchunk and chunksize parameters are not set, memory pool of 1 chunk will be created in the first call to allocate. The chunk size will be set to the n passed in for allocate(). If numchunk parameter is set to 0, the memory pool will use 1 for numchunk.
|
|
The destructor for the memory pool |
|
Increments the reference count for this memory pool allocator
|
|
This API throws an exception when n is greater than the fixed chunk size or there are no free chunk available in the pool, if "enablenullpointerreturn" has not been called. If the memory pool hasn't been created yet, the pool will be created with chunk size equal to n so n must be greater than 0. Exception will be thrown if memory allocation for the memory pool fails.
Implements Oscl_DefAlloc. |
|
This API will cancel any past callback requests..
|
|
|
|
This API throws an exception when the pointer p passed in is not part of the memory pool. Exception will be thrown if the memory pool is not set up yet.
Implements Oscl_DefAlloc. |
|
|
|
This API will disable exceptions in case the memory pool runs out of memory Instead of doing "OSCL_LEAVE(OsclErrNoResources)" allocate API will return NULL.
|
|
This API will set the flag to send a callback via specified observer object when the next memory chunk is deallocated by deallocate() call..
|
|
Decrements the reference count for this memory pool allocator When the reference count goes to 0, this instance of the memory pool object is deleted
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|