nn::fnd::UnitHeapTemplate::Create Member Functionstatic UnitHeapTemplate * Create( HeapBase * parent, size_t unit, void * addr, size_t size, s32 alignment = DEFAULT_ALIGNMENT, bit32 option = 0, bit32 placement = HEAP_INFOPLACEMENT_HEAD );
| Name | Description | |
|---|---|---|
| in | parent | Specifies the parent heap whose region contains addr. |
| in | unit | The size of the unit. |
| in | addr | The starting address of the memory used by the unit heap. |
| in | size | The size of the memory used by the unit heap. |
| in | alignment | The alignment of the unit. |
| in | option | Specifies options. (Not yet implemented.) |
| in | placement | Specifies the location where the management region (UnitHeap object) is located. |
Creates a unit heap within a heap.
Heaps that are created with this function must be destroyed using HeapBase::Destroy. The actual ExpHeap 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(ExpHeap).
Use the placement argument to specify where the ExpHeap object is placed. If you specify HEAP_INFOPLACEMENT_HEAD for placement, the actual ExpHeap object is placed at the start of the region (in other words, the region that starts at addr and ends at addr+sizeof(ExpHeap). If you specify HEAP_INFOPLACEMENT_TAIL for placement, the actual ExpHeap object is placed at the end of the region (in other words, the region that starts at addr+size-sizeof(ExpHeap) and ends at addr+size.
CONFIDENTIAL