OSAlloc

Syntax

#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. 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 from the current heap.

The memory allocation services must have first been initialized by the OSInitAlloc and OSCreateHeap functions; the heap is created by the OSCreateHeap function.

See Also

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

Revision History

2006/03/01 Initial version.


CONFIDENTIAL