OSAllocFromHeap

Syntax

#include <revolution/os.h>

void* OSAllocFromHeap(OSHeapHandle heap, u32 size);

Arguments

heap Handle to a heap that was returned from the OSCreateHeap function
size Size of object to be allocated.

Return Values

Returns a null pointer if allocation is unsuccessful. Otherwise, returns a pointer to the allocated region, aligned to a 32-byte boundary.

Description

Although this function is provided for the sake of compatibility, we recommend using the MEM library.

Allocates size bytes of memory from heap. Supplementary regions will be consumed from this heap. This overwrites the heap selected by the OSSetCurrentHeap function for this allocation.

The memory allocation services must be initialized by the OSInitAlloc function.

See Also

Memory Allocation Functions, OSInitAlloc, OSCreateHeap, OSFreeToHeap

Revision History

2006/03/01 Initial version.


CONFIDENTIAL