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 *)

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

Parameters

MMemoryCollector * aCollectorthe collector to be registered

AddStopper(MOOMStopper *)

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

Parameters

MOOMStopper * aStopperthe stopper to be registered

AllocFromPool(TUint)

TAny *AllocFromPool(TUintsz)
Since
3.1

Parameters

TUint sz

Allocate(TUint)

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

Parameters

TUint aSizebytes of memory to be allocated

CollectMemory(TUint)

voidCollectMemory(TUintaSize = -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(TUintaSize)[protected, pure virtual]
allocate a buffer
Since
3.1

Parameters

TUint aSize

Free(TAny *)

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

Parameters

TAny * aPtrpointer to the memory to be freed

FreeMemory(TFreeMem &)

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

Parameters

TFreeMem & aFree

InitOOMDialog()

voidInitOOMDialog()[virtual]

MemorySize(TAny *)

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

Parameters

TAny * aPtrpointer to the memory buffer

NotifyAndStop()

voidNotifyAndStop()[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(TUintaTotalSize,
TUintaMaxBufSize,
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 aTotalSizetotal amount of memory
TUint aMaxBufSize
const TDesC8 & aCheckerthe name of operation

ReAllocate(TAny *, TUint)

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

Parameters

TAny * aPtr
TUint aSizebytes of memory to be allocated

RemoveCollector(MMemoryCollector *)

voidRemoveCollector(MMemoryCollector *aCollector)
unregister a memory collector
Since
3.1

Parameters

MMemoryCollector * aCollectorthe collector to be unregistered

RemoveStopper(MOOMStopper *)

voidRemoveStopper(MOOMStopper *aStopper)
unregister a stopper
Since
3.1

Parameters

MOOMStopper * aStopperthe stopper to be unregistered

ResetOOMDialog()

voidResetOOMDialog()[virtual]

RestoreCollectors(TOOMPriority)

voidRestoreCollectors(TOOMPriorityaPriority)
restore the states of memory collectors
Since
3.1

Parameters

TOOMPriority aPriority

RestoreRescueBuffer()

voidRestoreRescueBuffer()[pure virtual]

SetNotifier(MOOMNotifier *)

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

Parameters

MOOMNotifier * aNotifierthe notifier

SetRescueBufferSize(TInt)

voidSetRescueBufferSize(TIntaSize)[pure virtual]
set the size of rescue buffer
Since
3.1

Parameters

TInt aSize

SetStatus(TOOMCheckResult)

voidSetStatus(TOOMCheckResultaStatus)
Since
3.1

Parameters

TOOMCheckResult aStatus

SetStopping(TBool)

voidSetStopping(TBoolaStopping)
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)

voidTriggerOOM(TOOMTypeaType)
Trigger an OOM event, this function is only for debugging purpose
Since
3.1

Parameters

TOOMType aTypedefines 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]