RAllocator Class Reference

class RAllocator : public MAllocator

Base class for heaps.

Inherits from

Public Member Functions
RAllocator()
IMPORT_C TAny *AllocL(TInt)
IMPORT_C TAny *AllocLC(TInt)
IMPORT_C TAny *AllocZ(TInt)
IMPORT_C TAny *AllocZL(TInt)
UIMPORT_C voidCheck()
IMPORT_C voidClose()
IMPORT_C TIntCount()
IMPORT_C TIntCount(TInt &)
IMPORT_C voidFreeZ(TAny *&)
IMPORT_C TIntOpen()
IMPORT_C TAny *ReAllocL(TAny *, TInt, TInt)
UIMPORT_C TUint__DbgCheckFailure()
UIMPORT_C TInt__DbgMarkCheck(TBool, TInt, const TDesC8 &, TInt)
void__DbgMarkCheck(TBool, TInt, const TUint8 *, TInt)
UIMPORT_C TUint32__DbgMarkEnd(TInt)
UIMPORT_C void__DbgMarkStart()
UIMPORT_C void__DbgSetAllocFail(TAllocFail, TInt)
UIMPORT_C void__DbgSetBurstAllocFail(TAllocFail, TUint, TUint)
Protected Member Functions
IMPORT_C voidDoClose()
UIMPORT_C TIntExtension_(TUint, TAny *&, TAny *)
Inherited Functions
MAllocator::Alloc(TInt)
MAllocator::AllocLen(const TAny *)const
MAllocator::AllocSize(TInt &)const
MAllocator::Available(TInt &)const
MAllocator::Compress()
MAllocator::DebugFunction(TInt,TAny *,TAny *)
MAllocator::Free(TAny *)
MAllocator::ReAlloc(TAny *,TInt,TInt)
MAllocator::Reset()
Public Member Enumerations
enumTAllocDebugOp {
ECount, EMarkStart, EMarkEnd, ECheck, ESetFail, ECopyDebugInfo, ESetBurstFail
}
enumTAllocFail {
ERandom, ETrueRandom, EDeterministic, ENone, EFailNext, EReset, EBurstRandom, EBurstTrueRandom, EBurstDeterministic, EBurstFailNext, ECheckFailure
}
enumTDbgHeapType { EUser, EKernel }
enumTFlags { ESingleThreaded = 1, EFixedSize = 2, ETraceAllocs = 4, EMonitorMemory = 8 }
enumTReAllocMode { ENeverMove = 1, EAllowMoveOnShrink = 2 }
Protected Attributes
TInt iAccessCount
TInt iCellCount
TUint32 iFlags
TInt iHandleCount
TInt *iHandles
TInt iTotalAllocSize

Constructor & Destructor Documentation

RAllocator()

RAllocator()[inline]

Member Functions Documentation

AllocL(TInt)

IMPORT_C TAny *AllocL(TIntaSize)

Parameters

TInt aSize

AllocLC(TInt)

IMPORT_C TAny *AllocLC(TIntaSize)

Parameters

TInt aSize

AllocZ(TInt)

IMPORT_C TAny *AllocZ(TIntaSize)

Parameters

TInt aSize

AllocZL(TInt)

IMPORT_C TAny *AllocZL(TIntaSize)

Parameters

TInt aSize

Check()

UIMPORT_C voidCheck()const

Close()

IMPORT_C voidClose()

Count()

IMPORT_C TIntCount()const

Count(TInt &)

IMPORT_C TIntCount(TInt &aFreeCount)const

Parameters

TInt & aFreeCount

DoClose()

IMPORT_C voidDoClose()[protected, virtual]

Extension_(TUint, TAny *&, TAny *)

UIMPORT_C TIntExtension_(TUintaExtensionId,
TAny *&a0,
TAny *a1
)[protected, virtual]

Parameters

TUint aExtensionId
TAny *& a0
TAny * a1

FreeZ(TAny *&)

IMPORT_C voidFreeZ(TAny *&aCell)

Parameters

TAny *& aCell

Open()

IMPORT_C TIntOpen()

ReAllocL(TAny *, TInt, TInt)

IMPORT_C TAny *ReAllocL(TAny *aCell,
TIntaSize,
TIntaMode = 0
)

Parameters

TAny * aCell
TInt aSize
TInt aMode = 0

__DbgCheckFailure()

UIMPORT_C TUint__DbgCheckFailure()

__DbgMarkCheck(TBool, TInt, const TDesC8 &, TInt)

UIMPORT_C TInt__DbgMarkCheck(TBoolaCountAll,
TIntaCount,
const TDesC8 &aFileName,
TIntaLineNum
)

Parameters

TBool aCountAll
TInt aCount
const TDesC8 & aFileName
TInt aLineNum

__DbgMarkCheck(TBool, TInt, const TUint8 *, TInt)

void__DbgMarkCheck(TBoolaCountAll,
TIntaCount,
const TUint8 *aFileName,
TIntaLineNum
)[inline]

Parameters

TBool aCountAll
TInt aCount
const TUint8 * aFileName
TInt aLineNum

__DbgMarkEnd(TInt)

UIMPORT_C TUint32__DbgMarkEnd(TIntaCount)

Parameters

TInt aCount

__DbgMarkStart()

UIMPORT_C void__DbgMarkStart()

__DbgSetAllocFail(TAllocFail, TInt)

UIMPORT_C void__DbgSetAllocFail(TAllocFailaType,
TIntaRate
)

Parameters

TAllocFail aType
TInt aRate

__DbgSetBurstAllocFail(TAllocFail, TUint, TUint)

UIMPORT_C void__DbgSetBurstAllocFail(TAllocFailaType,
TUintaRate,
TUintaBurst
)

Parameters

TAllocFail aType
TUint aRate
TUint aBurst

Member Enumerations Documentation

Enum TAllocDebugOp

Enumerators

ECount
EMarkStart
EMarkEnd
ECheck
ESetFail
ECopyDebugInfo
ESetBurstFail

Enum TAllocFail

A set of heap allocation failure flags.

This enumeration indicates how to simulate heap allocation failure.

RAllocator::__DbgSetAllocFail()

Enumerators

ERandom

Attempts to allocate from this heap fail at a random rate; however, the interval pattern between failures is the same every time simulation is started.

ETrueRandom

Attempts to allocate from this heap fail at a random rate. The interval pattern between failures may be different every time the simulation is started.

EDeterministic

Attempts to allocate from this heap fail at a rate aRate; for example, if aRate is 3, allocation fails at every third attempt.

ENone

Cancels simulated heap allocation failure.

EFailNext

An allocation from this heap will fail after the next aRate - 1 allocation attempts. For example, if aRate = 1 then the next attempt to allocate from this heap will fail.

EReset

Cancels simulated heap allocation failure, and sets the nesting level for all allocated cells to zero.

EBurstRandom

aBurst allocations from this heap fail at a random rate; however, the interval pattern between failures is the same every time the simulation is started.

EBurstTrueRandom

aBurst allocations from this heap fail at a random rate. The interval pattern between failures may be different every time the simulation is started.

EBurstDeterministic

aBurst allocations from this heap fail at a rate aRate. For example, if aRate is 10 and aBurst is 2, then 2 allocations will fail at every tenth attempt.

EBurstFailNext

aBurst allocations from this heap will fail after the next aRate - 1 allocation attempts have occurred. For example, if aRate = 1 and aBurst = 3 then the next 3 attempts to allocate from this heap will fail.

ECheckFailure

Use this to determine how many times the current debug failure mode has failed so far. RAllocator::__DbgCheckFailure()

Enum TDbgHeapType

Heap debug checking type flag.

Enumerators

EUser

The heap is a user heap.

EKernel

The heap is the Kernel heap.

Enum TFlags

Enumerators

ESingleThreaded = 1
EFixedSize = 2
ETraceAllocs = 4
EMonitorMemory = 8

Enum TReAllocMode

Flags controlling reallocation.

Enumerators

ENeverMove = 1

A reallocation of a cell must not change the start address of the cell.

EAllowMoveOnShrink = 2

Allows the start address of the cell to change if the cell shrinks in size.

Member Data Documentation

TInt iAccessCount

TInt iAccessCount[protected]

TInt iCellCount

TInt iCellCount[protected]

TUint32 iFlags

TUint32 iFlags[protected]

TInt iHandleCount

TInt iHandleCount[protected]

TInt * iHandles

TInt *iHandles[protected]

TInt iTotalAllocSize

TInt iTotalAllocSize[protected]