CMemoryPool Class Reference

class CMemoryPool
memman.lib
Since
3.1

Constructor & Destructor Documentation

CMemoryPool()

CMemoryPool ( ) [protected, inline]

~CMemoryPool()

~CMemoryPool ( ) [virtual]

Member Functions Documentation

AddCollector(MMemoryCollector *)

void AddCollector ( MMemoryCollector * aCollector )
register a memory collector, memory manager doesn't own this collector
Since
3.1

Parameters

MMemoryCollector * aCollector the collector to be registered

AddStopper(MOOMStopper *)

void AddStopper ( MOOMStopper * aStopper )
register a stopper, memory manager doesn't own this stopper.
Since
3.1

Parameters

MOOMStopper * aStopper the stopper to be registered

AllocFromPool(TUint)

TAny * AllocFromPool ( TUint sz )
Since
3.1

Parameters

TUint sz

Allocate(TUint)

TAny * Allocate ( TUint aSize ) [pure virtual]
allocate a memory buffer
Since
3.1

Parameters

TUint aSize bytes of memory to be allocated

CollectMemory(TUint)

void CollectMemory ( TUint aSize = -1 )
collect free memory from memory collectors
Since
3.1

Parameters

TUint aSize = -1

Create()

TBool Create ( ) [virtual]
create the allocator
Since
3.1

DebugOOM()

TUint DebugOOM ( ) [inline]
Since
3.1

DoAlloc(TUint)

TAny * DoAlloc ( TUint aSize ) [protected, pure virtual]
allocate a buffer
Since
3.1

Parameters

TUint aSize

Free(TAny *)

void Free ( TAny * aPtr ) [pure virtual]
free the memory
Since
3.1

Parameters

TAny * aPtr pointer to the memory to be freed

FreeMemory(TFreeMem &)

TUint FreeMemory ( TFreeMem & aFree ) [pure virtual]
Since
3.1

Parameters

TFreeMem & aFree

InitOOMDialog()

void InitOOMDialog ( ) [virtual]

MemorySize(TAny *)

TUint MemorySize ( TAny * aPtr ) [pure virtual]
get the size of a memory buffer
Since
3.1

Parameters

TAny * aPtr pointer to the memory buffer

NotifyAndStop()

void NotifyAndStop ( ) [protected]
utility function, notify the user and stop ongoing operations
Since
3.1

PostCheck()

TUint PostCheck ( ) [pure virtual]
An additional check after an operation is completed.
Since
3.1

PreCheck(TUint, TUint, const TDesC8 &)

TBool PreCheck ( TUint aTotalSize,
TUint aMaxBufSize,
const TDesC8 & aChecker
) [pure virtual]
check if the memory manager is able to reserve enough memory for the coming operation.
Since
3.1

Parameters

TUint aTotalSize total amount of memory
TUint aMaxBufSize
const TDesC8 & aChecker the name of operation

ReAllocate(TAny *, TUint)

TAny * ReAllocate ( TAny * aPtr,
TUint aSize
) [pure virtual]
realloc a memory buffer
Since
3.1

Parameters

TAny * aPtr
TUint aSize bytes of memory to be allocated

RemoveCollector(MMemoryCollector *)

void RemoveCollector ( MMemoryCollector * aCollector )
unregister a memory collector
Since
3.1

Parameters

MMemoryCollector * aCollector the collector to be unregistered

RemoveStopper(MOOMStopper *)

void RemoveStopper ( MOOMStopper * aStopper )
unregister a stopper
Since
3.1

Parameters

MOOMStopper * aStopper the stopper to be unregistered

ResetOOMDialog()

void ResetOOMDialog ( ) [virtual]

RestoreCollectors(TOOMPriority)

void RestoreCollectors ( TOOMPriority aPriority )
restore the states of memory collectors
Since
3.1

Parameters

TOOMPriority aPriority

RestoreRescueBuffer()

void RestoreRescueBuffer ( ) [pure virtual]

SetNotifier(MOOMNotifier *)

void SetNotifier ( MOOMNotifier * aNotifier )
set the OOM notifier, memory manager doesn't own this notifier
Since
3.1

Parameters

MOOMNotifier * aNotifier the notifier

SetRescueBufferSize(TInt)

void SetRescueBufferSize ( TInt aSize ) [pure virtual]
set the size of rescue buffer
Since
3.1

Parameters

TInt aSize

SetStatus(TOOMCheckResult)

void SetStatus ( TOOMCheckResult aStatus )
Since
3.1

Parameters

TOOMCheckResult aStatus

SetStopping(TBool)

void SetStopping ( TBool aStopping )
toggle the stopping status of memory manager
Since
3.1

Parameters

TBool aStopping

Status()

TUint Status ( ) [inline]
get status of memory manager
Since
3.1

Stoppers()

RPointerArray < MOOMStopper > & Stoppers ( ) [inline]
get the array of stoppers, used by stopscheduler
Since
3.1

TriggerOOM(TOOMType)

void TriggerOOM ( TOOMType aType )
Trigger an OOM event, this function is only for debugging purpose
Since
3.1

Parameters

TOOMType aType defines where memory allocation fails

Member Data Documentation

RPointerArray< MMemoryCollector > iCollectors

RPointerArray < MMemoryCollector > iCollectors [protected]

TBool iIsCollecting

TBool iIsCollecting [protected]

TBool iIsStopping

TBool iIsStopping [protected]

TUint iMemStatus

TUint iMemStatus [protected]

TInt iNestedChecks

TInt iNestedChecks [protected]

MOOMNotifier * iNotifier

MOOMNotifier * iNotifier [protected]

TUint iOOMType

TUint iOOMType [protected]

CStopScheduler * iStopScheduler

CStopScheduler * iStopScheduler [protected]

RPointerArray< MOOMStopper > iStoppers

RPointerArray < MOOMStopper > iStoppers [protected]