Create

nn::fnd::FrameHeapTemplate::Create Member Function

Syntax

static FrameHeapTemplate * Create(
     HeapBase * parent,
     void * addr,
     size_t size,
     bit32 option = 0,
     bit32 placement = HEAP_INFOPLACEMENT_HEAD
);

Parameters

Name Description
in parent Specifies the parent heap whose region contains addr.
in addr The starting address of the memory block to allocate to the frame heap. Specify a memory block that has been allocated within the heap specified by parent.
in size The size of the memory block to allocate to the frame heap.
in option Specifies options. (Not yet implemented.)
in placement Specifies the location where the management region (FrameHeap object) is located.

Return Values

Returns the created heap.

Description

Creates a frame heap within a parent heap.

Heaps that are created with this function must be freed using HeapBase::Destroy.

The actual FrameHeap object is created within the region defined by the values specified for the addr and size arguments. This means that the actual size allocated to the heap is the size of the specified region minus sizeof(FrameHeap).

Use the placement argument to specify where the FrameHeap object is placed. If you specify HEAP_INFOPLACEMENT_HEAD for placement, the actual FrameHeap object is placed at the start of the region (in other words, the region that starts at addr and ends at addr+sizeof(FrameHeap). If you specify HEAP_INFOPLACEMENT_TAIL for placement, the actual FrameHeap object is placed at the end of the region (in other words, the region that starts at addr+size-sizeof(FrameHeap) and ends at addr+size.

Revision History

2010/01/08
Added the placement argument, which is used to specify where to place the management region.
2010/01/07
Initial version.

CONFIDENTIAL