#include <cafe/mem.h>

static inline MEMHeapHandle
    void*   startAddress,
    u32     heapSize,
    u32     memBlockSize


startAddress Start address of the memory region to allocate to the heap.
heapSize Size in bytes of the memory region allocated to the heap.
memBlockSize Size of the memory block in bytes.

Return Values

Returns the heap handle when a heap was successfully created. Returns MEM_HEAP_INVALID_HANDLE (a null value) if a heap could not be created.


Creates the unit heap. The heap region is a memory region with a size specified by heapSize and a start address specified by startAddress.

Each memory block has a fixed size specified by memBlockSize. The memory block alignment is 4.

Do Not Call From

Multiple threads This function is not thread-safe.
Callbacks Do not call this function from any callback function.

See Also


Revision History

2013/05/08 Automated cleanup pass.
2010/11/01 Initial version.