Photon Quantum 3.0.0

Public Member Functions | List of all members
Quantum.Allocator.IFrameHeap Interface Reference

Custom heap interface for allocating memory on the frame. More...

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

Public Member Functions

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 * 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...
 
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...
 

Detailed Description

Custom heap interface for allocating memory on the frame.

Member Function Documentation

◆ Allocate()

void* Quantum.Allocator.IFrameHeap.Allocate ( int  size)

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.

Implemented in Quantum.Allocator.FrameHeap.

◆ AllocatePtr()

Ptr Quantum.Allocator.IFrameHeap.AllocatePtr ( int  size)

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.

Implemented in Quantum.Allocator.FrameHeap.

◆ AllocateAndClear()

void* Quantum.Allocator.IFrameHeap.AllocateAndClear ( int  size)

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.

Implemented in Quantum.Allocator.FrameHeap.

◆ AllocateAndClearPtr()

Ptr Quantum.Allocator.IFrameHeap.AllocateAndClearPtr ( int  size)

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.

Implemented in Quantum.Allocator.FrameHeap.

◆ ExpandArray< T >()

T* Quantum.Allocator.IFrameHeap.ExpandArray< T > ( T *  buffer,
int  currentSize,
int  newSize 
)

Expands an array in the given buffer to the specified new size.

Template Parameters
TThe type of the elements in the array.
Parameters
bufferThe buffer containing the array.
currentSizeThe current size of the array.
newSizeThe new size of the array.
Returns
A pointer to the expanded array.
Type Constraints
T :unmanaged 

◆ Expand()

void* Quantum.Allocator.IFrameHeap.Expand ( void *  buffer,
int  currentSize,
int  newSize 
)

Expands a memory block in the given buffer to the specified new size.

Parameters
bufferThe buffer containing the memory block.
currentSizeThe current size of the memory block.
newSizeThe new size of the memory block.
Returns
A pointer to the expanded memory block.

◆ Free() [1/2]

void Quantum.Allocator.IFrameHeap.Free ( void *  ptr)

Frees a block of memory.

Parameters
ptrA pointer to the memory block to free.

Implemented in Quantum.Allocator.FrameHeap, and Quantum.Allocator.Heap.

◆ Free() [2/2]

void Quantum.Allocator.IFrameHeap.Free ( Ptr  ptr)

Frees a Ptr for a block of memory.

Parameters
ptrA Ptr for the memory block to free.

Implemented in Quantum.Allocator.FrameHeap, and Quantum.Allocator.Heap.

◆ Void() [1/2]

Ptr Quantum.Allocator.IFrameHeap.Void ( void *  ptr)

Converts a pointer to a void pointer.

Parameters
ptrA pointer to convert.
Returns
A void pointer.

Implemented in Quantum.Allocator.FrameHeap, and Quantum.Allocator.Heap.

◆ Void() [2/2]

void* Quantum.Allocator.IFrameHeap.Void ( Ptr  p)

Converts a Ptr to a void pointer.

Parameters
pA Ptr to convert.
Returns
A void pointer.

Implemented in Quantum.Allocator.FrameHeap, and Quantum.Allocator.Heap.

◆ Void< TPtr >()

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

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.

Implemented in Quantum.Allocator.FrameHeap.

Type Constraints
TPtr :unmanaged