nn::fnd::ExpHeapTemplate

nn::fnd::ExpHeapTemplate Class

Syntax

template <class LockPolicy>
class ExpHeapTemplate :public nn::fnd::ExpHeapBase

Template Arguments

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

Description

Class template for the expanded 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::ExpHeapTemplate::Allocator Allocator class for the expanded heap.

Member Functions

ExpHeapTemplate Constructor.
Initialize Initializes the heap.
Invalidate Invalidates the heap.
Finalize If the heap is valid, it destroys it.
V ~ExpHeapTemplate Destructor. Calls Finalize.
Allocate Allocates memory from the expanded heap.
Free Frees a memory block that was allocated from the expanded heap.
V FreeV Frees a memory block that was allocated from the expanded heap.
ResizeBlock Changes the size of a memory block that was allocated from the expanded heap.
VisitAllBlocks Calls a user-specified visitor function on all memory blocks that have been allocated from the expanded heap.
V GetStartAddress Gets the starting address of the expanded heap's memory region.
V GetTotalSize Gets the memory size assigned to the expanded heap.
GetTotalFreeSize Gets the available memory size of the expanded heap.
GetAllocatableSize Gets the size of the memory block that can be allocated from the expanded heap.
Adjust Use of this function is NOT recommended. This function frees unused areas at the tail of the expanded heap to reduce the amount of memory the expanded heap uses.
CheckHeap Checks whether the expanded heap has been destroyed.
CheckBlock Checks memory blocks that have been allocated from the expanded heap.
V HasAddress Determines whether the specified address is located within a heap.
V Dump Displays a heap's internal information. (Used for debugging.)
S Create Creates an expanded heap within a parent heap.

Class Hierarchy

nn::util::NonCopyable
  nn::fnd::IntrusiveLinkedList
    nn::fnd::HeapBase
      nn::fnd::ExpHeapBase
        nn::fnd::ExpHeapTemplate

Revision History

2010/01/07
Initial version.

CONFIDENTIAL