Quantum 3 3.1.0

Public Member Functions | Static Public Member Functions | Properties | List of all members
Quantum.Allocator.FrameHeap Class Reference

A managed type that wraps a heap object and an allocation tracker. More...

Inheritance diagram for Quantum.Allocator.FrameHeap:
Quantum.Allocator.IFrameHeap

Public Member Functions

 FrameHeap (ITrackableFrameHeap heap, IHeapAllocationTracker tracker)
 Creates a new instance of FrameHeap. More...
 
void * Allocate (int size)
 Allocates a block of memory of the specified size. More...
 
void * AllocateAndClear (int size)
 Allocates a block of memory of the specified size and clears it. More...
 
Ptr AllocateAndClearPtr (int size)
 Allocates a Ptr for a block of memory of the specified size and clears it. More...
 
Ptr AllocatePtr (int size)
 Allocates a Ptr for a block of memory of the specified size. More...
 
void Free (Ptr ptr)
 Frees a Ptr for a block of memory. More...
 
void Free (void *ptr)
 Frees a block of memory. More...
 
Heap.Stats GetStats ()
 Return a compact statistic report about the memory usage. More...
 
void * Void (Ptr p)
 Converts a Ptr to a void pointer. More...
 
Ptr Void (void *ptr)
 Converts a pointer to a void pointer. More...
 
TPtr * Void< TPtr > (Ptr p)
 Converts a Ptr to a typed pointer. More...
 
- Public Member Functions inherited from Quantum.Allocator.IFrameHeap
void * Expand (void *buffer, int currentSize, int newSize)
 Expands a memory block in the given buffer to the specified new size. More...
 
T * ExpandArray< T > (T *buffer, int currentSize, int newSize)
 Expands an array in the given buffer to the specified new size. More...
 

Static Public Member Functions

static void Print (FrameHeap heap, FramePrinter printer)
 Prints the frame heap using a FramePrinter. More...
 

Properties

ITrackableFrameHeap Heap [get]
 Access the underlying heap object. More...
 
IHeapAllocationTracker Tracker [get]
 Access the allocation tracker. More...
 
- Properties inherited from Quantum.Allocator.IFrameHeap
int PageSize [get]
 The size of a page in the heap. More...
 

Detailed Description

A managed type that wraps a heap object and an allocation tracker.

Constructor & Destructor Documentation

◆ FrameHeap()

Quantum.Allocator.FrameHeap.FrameHeap ( ITrackableFrameHeap  heap,
IHeapAllocationTracker  tracker 
)
inline

Creates a new instance of FrameHeap.

Parameters
heapThe heap instance
trackerThe tracker instance

Member Function Documentation

◆ Allocate()

void* Quantum.Allocator.FrameHeap.Allocate ( int  size)
inline

Allocates a block of memory of the specified size.

Parameters
sizeThe size of the memory block to allocate.
Returns
A pointer to the allocated memory block.

Implements Quantum.Allocator.IFrameHeap.

◆ AllocatePtr()

Ptr Quantum.Allocator.FrameHeap.AllocatePtr ( int  size)
inline

Allocates a Ptr for a block of memory of the specified size.

Parameters
sizeThe size of the memory block to allocate.
Returns
A Ptr for the allocated memory block.

Implements Quantum.Allocator.IFrameHeap.

◆ AllocateAndClear()

void* Quantum.Allocator.FrameHeap.AllocateAndClear ( int  size)
inline

Allocates a block of memory of the specified size and clears it.

Parameters
sizeThe size of the memory block to allocate.
Returns
A pointer to the allocated and cleared memory block.

Implements Quantum.Allocator.IFrameHeap.

◆ AllocateAndClearPtr()

Ptr Quantum.Allocator.FrameHeap.AllocateAndClearPtr ( int  size)
inline

Allocates a Ptr for a block of memory of the specified size and clears it.

Parameters
sizeThe size of the memory block to allocate.
Returns
A Ptr for the allocated and cleared memory block.

Implements Quantum.Allocator.IFrameHeap.

◆ Free() [1/2]

void Quantum.Allocator.FrameHeap.Free ( Ptr  ptr)
inline

Frees a Ptr for a block of memory.

Parameters
ptrA Ptr for the memory block to free.

Implements Quantum.Allocator.IFrameHeap.

◆ Free() [2/2]

void Quantum.Allocator.FrameHeap.Free ( void *  ptr)
inline

Frees a block of memory.

Parameters
ptrA pointer to the memory block to free.

Implements Quantum.Allocator.IFrameHeap.

◆ Void() [1/2]

Ptr Quantum.Allocator.FrameHeap.Void ( void *  ptr)
inline

Converts a pointer to a void pointer.

Parameters
ptrA pointer to convert.
Returns
A void pointer.

Implements Quantum.Allocator.IFrameHeap.

◆ Void() [2/2]

void* Quantum.Allocator.FrameHeap.Void ( Ptr  p)
inline

Converts a Ptr to a void pointer.

Parameters
pA Ptr to convert.
Returns
A void pointer.

Implements Quantum.Allocator.IFrameHeap.

◆ Void< TPtr >()

TPtr* Quantum.Allocator.FrameHeap.Void< TPtr > ( Ptr  p)
inline

Converts a Ptr to a typed pointer.

Template Parameters
TPtrThe type of the pointer to convert to.
Parameters
pA Ptr to convert.
Returns
A typed pointer.

Implements Quantum.Allocator.IFrameHeap.

Type Constraints
TPtr :unmanaged 

◆ GetStats()

Heap.Stats Quantum.Allocator.FrameHeap.GetStats ( )
inline

Return a compact statistic report about the memory usage.

Returns

◆ Print()

static void Quantum.Allocator.FrameHeap.Print ( FrameHeap  heap,
FramePrinter  printer 
)
inlinestatic

Prints the frame heap using a FramePrinter.

Parameters
heapHeap object
printerPrinter object

Property Documentation

◆ Heap

ITrackableFrameHeap Quantum.Allocator.FrameHeap.Heap
get

Access the underlying heap object.

◆ Tracker

IHeapAllocationTracker Quantum.Allocator.FrameHeap.Tracker
get

Access the allocation tracker.