Photon Quantum 3.0.0

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

Managed frame heap type that wraps a unmanaged Heap instance. More...

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

Public Member Functions

 FrameHeap (Heap *heapUnsafe, 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...
 
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...
 

Properties

HeapHeapUnsafe [get]
 Access the unmanaged Heap instance. More...
 
IHeapAllocationTracker Tracker [get]
 Access the allocation tracker. More...
 

Detailed Description

Managed frame heap type that wraps a unmanaged Heap instance.

Constructor & Destructor Documentation

◆ FrameHeap()

Quantum.Allocator.FrameHeap.FrameHeap ( Heap heapUnsafe,
IHeapAllocationTracker  tracker 
)
inline

Creates a new instance of FrameHeap.

Parameters
heapUnsafeThe unmanaged 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 

Property Documentation

◆ HeapUnsafe

Heap* Quantum.Allocator.FrameHeap.HeapUnsafe
get

Access the unmanaged Heap instance.

◆ Tracker

IHeapAllocationTracker Quantum.Allocator.FrameHeap.Tracker
get

Access the allocation tracker.