Allocate

nn::fnd::FrameHeapTemplate::Allocate Member Function

Syntax

void * Allocate(
     size_t size,
     s32 alignment = DEFAULT_ALIGNMENT
);

Parameters

Name Description
in size Specifies the size (in bytes) of the memory block to allocate.
in alignment Specifies the alignment. Specify one of the following values: 4, 8, 16, 32, -4, -8, -16, or -32.

Return Values

Returns the starting address of the allocated memory block.

Description

Allocates memory from the frame heap.

Memory is allocated from the beginning of the heap when you specify a positive alignment, and from the end of the heap when you specify a negative alignment.

Revision History

2010/08/20
Mentioned that you can use a positive or negative alignment to specify the direction to allocate from. Fixed typos.
2010/01/07
Initial version.

CONFIDENTIAL