nw::snd::SoundHeap::Alloc Member Function

Syntax

#include <nw/snd/snd_SoundHeap.h>
void * Alloc(
     size_t size,
     SoundHeap::DisposeCallback callback,
     void* callbackArg
);

Arguments

Name Description
in size Memory size to be allocated.
in callback The callback function to invoke when the memory block is freed.
in callbackArg User data for the argument of the callback function.

Return Values

Returns the starting address of the allocated memory block.

Description

Allocates memory from the sound heap.

A management region is needed in each memory block. As a result, you actually need slightly more free space than the memory size being allocated (size). The function will fail if there is not enough space.

The callback function (callback) is invoked when memory blocks are freed by Clear or LoadState. Set the callback to NULL if it is unnecessary.

Revision History

2009/12/28
Initial version.

CONFIDENTIAL