MEMAllocFromExpHeapEx

C Specification

#include <revolution/mem.h>

void* MEMAllocFromExpHeapEx(
MEMHeapHandle    heap,
u32              size,
int     alignment);

Arguments

heap Expanded heap handle.
size Size of memory block in bytes.
alignment Memory block alignment.
The following values can be specified: 4, 8, 16, 32, 64, 128, -4, -8, -16, -32, -64, -128.

Return Values

When the memory block is allocated, the start address of this memory block is returned. When the memory cannot be allocated, NULL is returned.

Description

Allocates a memory block from the expanded heap. Memory block alignment is specified by alignment. If the alignment is a negative value, the memory block is allocated from the top of the free region in the heap.

If the memory block is allocatable, the actual size of the memory block may be greater than the specified size. To determine the actual allocated size in bytes, use the MEMGetSizeForMBlockExpHeap function.

See Also

MEMAllocFromExpHeap, MEMFreeToExpHeap, MEMCreateExpHeap, MEMCreateExpHeapEx

Revision History

03/01/2006 Initial version.