OSAlloc

C Specification

#include <revolution/os.h>
void* OSAlloc (u32 size);

Arguments

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 current heap.

You must use the OSInitAlloc and OSCreateHeap functions first to initialize the memory allocation feature and the OSCreateHeap function to create a heap.

See Also

Memory Allocation Functions, OSInitAlloc,OSCreateHeap,OSAllocFromHeap, OSFree, OSSetCurrentHeap

Revision History

03/01/2006 Initial version.