Photon Quantum 3.0.0

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Photon.Deterministic.Native Class Reference

Native is a collections of tools that interact with the platform's native code directly like memory allocation, copy operations, etc. More...

Classes

class  Allocator
 Represents native memory allocations and is used in many places across the engine. More...
 
struct  AllocatorVTable
 Equal to the AllocatorVTableManaged but with marshaled function pointers. More...
 
class  AllocatorVTableManaged
 A class that wraps memory allocation methods to be used in native code parts of the engine. More...
 
class  LIBCAllocator
 The libc native allocator implementation. More...
 
class  LIBCUtility
 The libc native memory utility implementation. More...
 
class  MSVCRTAllocator
 The MSVCRT native allocator implementation. More...
 
class  MSVCRTUtility
 The MSVCRT native memory utility implementation. More...
 
class  PInvokeAllocator
 A specific allocator that tracks allocations in Debug mode. More...
 
class  Utility
 Represents a collection of memory utility functions that interact with the platform's native code directly. More...
 

Public Member Functions

unsafe delegate IntPtr AllocateDelegate (UIntPtr size)
 An memory delegate used by AllocatorVTableManaged. More...
 
unsafe delegate int CompareDelegate (IntPtr ptr1, IntPtr ptr2, UIntPtr size)
 An memory delegate used by AllocatorVTableManaged. More...
 
unsafe delegate void CopyDelegate (IntPtr dst, IntPtr src, UIntPtr size)
 An memory delegate used by AllocatorVTableManaged. More...
 
unsafe delegate void FreeDelegate (IntPtr ptr)
 An memory delegate used by AllocatorVTableManaged. More...
 
unsafe delegate void MoveDelegate (IntPtr dst, IntPtr src, UIntPtr size)
 An memory delegate used by AllocatorVTableManaged. More...
 
unsafe delegate void SetDelegate (IntPtr ptr, byte value, UIntPtr size)
 An memory delegate used by AllocatorVTableManaged. More...
 

Static Public Member Functions

static int GetAlignmentForArrayElement (int elementSize)
 Calculates the alignment for arrays. More...
 
static int RoundUpToAlignment (int size, int alignment)
 Rounds the size up to the nearest multiple of the alignment. More...
 

Static Public Attributes

static Utility Utils
 A static fields that is expected to be set before the engine is initialized. More...
 

Detailed Description

Native is a collections of tools that interact with the platform's native code directly like memory allocation, copy operations, etc.

Member Function Documentation

◆ RoundUpToAlignment()

static int Photon.Deterministic.Native.RoundUpToAlignment ( int  size,
int  alignment 
)
inlinestatic

Rounds the size up to the nearest multiple of the alignment.

Supports up to alignment 64.

Parameters
sizeThe size to round.
alignmentThe alignment to use.
Returns
The rounded size.
Exceptions
InvalidOperationExceptionIs raised when the alignment is not supported.

◆ GetAlignmentForArrayElement()

static int Photon.Deterministic.Native.GetAlignmentForArrayElement ( int  elementSize)
inlinestatic

Calculates the alignment for arrays.

Parameters
elementSizeThe array element count.
Returns
8 is the count is larger than 0 and a multiple of 8, otherwise 4.

◆ AllocateDelegate()

unsafe delegate IntPtr Photon.Deterministic.Native.AllocateDelegate ( UIntPtr  size)

An memory delegate used by AllocatorVTableManaged.

◆ FreeDelegate()

unsafe delegate void Photon.Deterministic.Native.FreeDelegate ( IntPtr  ptr)

An memory delegate used by AllocatorVTableManaged.

◆ CopyDelegate()

unsafe delegate void Photon.Deterministic.Native.CopyDelegate ( IntPtr  dst,
IntPtr  src,
UIntPtr  size 
)

An memory delegate used by AllocatorVTableManaged.

◆ MoveDelegate()

unsafe delegate void Photon.Deterministic.Native.MoveDelegate ( IntPtr  dst,
IntPtr  src,
UIntPtr  size 
)

An memory delegate used by AllocatorVTableManaged.

◆ SetDelegate()

unsafe delegate void Photon.Deterministic.Native.SetDelegate ( IntPtr  ptr,
byte  value,
UIntPtr  size 
)

An memory delegate used by AllocatorVTableManaged.

◆ CompareDelegate()

unsafe delegate int Photon.Deterministic.Native.CompareDelegate ( IntPtr  ptr1,
IntPtr  ptr2,
UIntPtr  size 
)

An memory delegate used by AllocatorVTableManaged.

Member Data Documentation

◆ Utils

Utility Photon.Deterministic.Native.Utils
static

A static fields that is expected to be set before the engine is initialized.