PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBHeap
Wrapper Class for the IHeap interface.
#include <SFBHeap.h.hpp>
class SFBHeap : public SFBBase;
SFMTYPEDEFWRAPPER(SFBHeap)

Inheritance diagram

 Inheritance diagram of SFBHeapClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IHeap

Member

Public Functions
Bool CheckAvail( UInt32 size )
Check whether a memory block of the given size can be allocated.
Void Free( VoidPtr mem )
Free an allocated block of memory.
UInt32 GetMemStats( Void )
Return statistics about the total memory currently in use.
VoidPtr Malloc( UInt32 size )
Allocate a block of memory of the requested size and returns a pointer to that memory block.
T * MallocRec( Void )
Allocate the memory required for the specified standard data type. It then casts the allocated pointer to that data type before returning to the caller.
static
SFBHeapSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBHeap instance.
static
SFBHeapSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBHeap instance.
VoidPtr Realloc( VoidPtr mem , UInt32 size )
Reallocate a memory block and changes its size.
WCharPtr StrDup( WCharPtr string )
Duplicate a given string.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBHeap::CheckAvail
Check whether a memory block of the given size can be allocated.
[ public ]
Bool CheckAvail(
    UInt32 size   // size of the block whose allocation needs to be verified
);

Reference

BREW API IHEAP_CheckAvail | SFBHeap::GetMemStats


SFBHeap::Free
Free an allocated block of memory.
[ public ]
Void Free(
    VoidPtr mem   // pointer to the memory block that is to be freed
);

Reference

BREW API IHEAP_Free


SFBHeap::GetMemStats
Return statistics about the total memory currently in use.
[ public ]
UInt32 GetMemStats(Void);

Reference

BREW API IHEAP_GetMemStats | SFBHeap::CheckAvail | SFBShell::GetDeviceInfo


SFBHeap::Malloc
Allocate a block of memory of the requested size and returns a pointer to that memory block.
[ public ]
VoidPtr Malloc(
    UInt32 size   // specifies the size of the memory block to be allocated 
);

Reference

BREW API IHEAP_Malloc | SFBHeap::Realloc | SFBHeap::MallocRec


SFBHeap::MallocRec
Allocate the memory required for the specified standard data type. It then casts the allocated pointer to that data type before returning to the caller.
[ public ]
T * MallocRec(Void);

Reference

BREW API IHEAP_MallocRec


SFBHeap::NewInstance
Create a new SFBHeap instance.
[ public, static ]
SFBHeapSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBHeapSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBHeap::Realloc
Reallocate a memory block and changes its size.
[ public ]
VoidPtr Realloc(
    VoidPtr mem   // pointer to the memory block that needs to be reallocated. 
		// if pMemblock is null: this function behaves the same way as SFBHEAP::Malloc() 
		// and allocates a new block of dwNewSize bytes
    UInt32 size   // specifies the new size of the memory block
);

Reference

BREW API IHEAP_Realloc


SFBHeap::StrDup
Duplicate a given string.
[ public ]
WCharPtr StrDup(
    WCharPtr string   // pointer to the string that needs to be duplicated
);

Reference

BREW API IHEAP_StrDup