NNS_SndHeapAlloc

C Specification

#include <nnsys/snd.h>
typedef void (*NNSSndHeapDisposeCallback)( void*   mem, u32     size, u32     data1, u32     data2 );
void* NNS_SndHeapAlloc(
NNSSndHeapHandle    heap,
u32                         size,
NNSSndHeapDisposeCallback   callback,
u32 data1,
u32 data2 );

Arguments

heap The sound heap handle.
size The memory size to be allocated.
callback The callback function called when the memory block is de-allocated.
data1, data2 The user data for the argument of the callback function.

Return Values

Returns the starting address of the allocated memory block. Returns a NULL if the allocation fails.

Description

Allocates memory from the sound heap.

A management region is needed in each memory block. In actuality, a space slightly larger than the memory size size to be allocated is necessary. The function will fail if there is not enough space.

The callback function callback is called when the memory block is de-allocated via the NNS_SndHeapClear function or the NNS_SndHeapLoadState function. The memory block starting address mem, the memory block size size, and the user data data1 and data2 are passed to the argument of the callback function. Enter a NULL into callback when the callback function is not needed.

See Also

NNS_SndHeapClear, NNS_SndHeapLoadState

Revision History

06/01/2004 Initial version.