alHeapAlloc (macro)

Allocates memory from a Nintendo 64 audio heap

Syntax

#include <libaudio.h>     /* libaudio.h */
void *alHeapAlloc(ALHeap *hp, s32 num, s32 size);

Arguments

hp
Pointer to the ALHeap structure

num
Number of records to allocate

size
Size, in bytes, of the records to allocate

Description

alHeapAlloc allocates cache-aligned memory from an audio DRAM heap.

In the debug version of the libultra library (libultra_d), this function also inserts some debugging information that allows the alHeapCheck function to test for heap consistency.

Most memory management schemes allocate additional memory for region headers to facilitate the management of the memory region. The non-debug version of this function does not allocate any memory other than that requested or required for cache alignment. As a result, memory allocated from audio heaps cannot be freed.

Note that cache alignment is important for structures that contain elements shared with the reality co-processor (RCP).

See Also

alHeapInit, alHeapCheck

Revision History

1999/04/30 Changed Format