OSAllocFromHeap

C Specification

#include <revolution/os.h>
void* OSAllocFromHeap (OSHeapHandle heap, u32 size);

Arguments

heap Heap handle that was returned from the OSCreateHeap function.
size Size of object to allocate.

Return Values

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

Description

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

Allocates size bytes from the heap that heap specifies. Some additional heap region will be consumed. This consumed region overwrites the heap selected by the OSSetCurrentHeap function for allocation to occur.

The memory allocation process must be initialized by the OSInitAlloc function first.

See Also

Memory Allocation Functions, OSInitAlloc,OSCreateHeap, OSFreeToHeap

Revision History

03/01/2006 Initial version.