nn::fnd::UnitHeapTemplate

nn::fnd::UnitHeapTemplate Class

Syntax

template <class LockPolicy>
class UnitHeapTemplate :public nn::fnd::UnitHeapBase

Template Arguments

Name Description
LockPolicy Specifies the lock policy to use during operations on the heap.

Description

Class template for the unit heap.

In classes that instantiate this class template, mutual exclusion is done using the lock policy specified by this function. For the lock policy, you can either specify one of the classes declared within the nn::os::LockPolicy class, or specify a class that instantiates the class template. Neither operation nor compatibility is guaranteed if you specify any other class for the LockPolicy argument.

Locking is only performed on operations within the heap. If you want to perform operations on the heap hierarchy, you must take additional appropriate measures to ensure exclusive access.

Classes

nn::fnd::UnitHeapTemplate::Allocator Allocator class for the unit heap.

Member Functions

S GetRequiredHeapSize Gets the minimum size of heap memory required to manage the specified number of blocks of the specified unit size and alignment.
S Create Creates a unit heap within a heap.
UnitHeapTemplate Constructor. No initialization is performed.
Initialize Initializes the unit heap using the specified parameters. Used for objects that were created using the non-initializing constructor.
Invalidate Invalidates the heap object. After this function is called, no operations except Finalize can be performed on the heap.
Finalize Ends a heap object. This function is implicitly called by the destructor, so you do not need to call it explicitly.
V ~UnitHeapTemplate Destructor.
Allocate Allocates memory from the heap based on the unit.
Free Frees memory allocated from the calling heap.
V FreeV Frees memory allocated from the calling heap.
GetUnitSize Gets the unit size of the calling unit heap.
GetAllocatableCount Gets the number of units that can currently be allocated from the calling heap.
GetAllocatedCount Gets the number of units that are currently being allocated from this heap.
GetAlignment Gets the unit alignment.
V GetStartAddress Gets the starting address of the unit heap's memory region.
V GetTotalSize Gets the memory size allocated to the unit heap.
V Dump Displays a heap's internal information. (Used for debugging.)
V HasAddress Determines whether the specified address is located within a heap.

Class Hierarchy

nn::util::NonCopyable
  nn::fnd::IntrusiveLinkedList
    nn::fnd::HeapBase
      nn::fnd::UnitHeapBase
        nn::fnd::UnitHeapTemplate

Revision History

2010/01/07
Initial version.

CONFIDENTIAL