Skip to main content
Version: 14 Oct 2024

UnsafeUtilityEx

NameSpace: Unsafe

Public Methods

T * Calloc< T >

public static T * Calloc< T >(
Allocator allocator,
T initialValue =default
)

Parameters

TypeNameDescription
Allocatorallocator
TinitialValue

T * CallocTracked< T >

public static T * CallocTracked< T >(
Allocator allocator,
T initialValue =default,
int callstacksToSkip =1
)

Parameters

TypeNameDescription
Allocatorallocator
TinitialValue
intcallstacksToSkip

void CheckTypeSizeAndThrow< T >

public static void CheckTypeSizeAndThrow< T >(
int expectedTypeSize
)

Parameters

TypeNameDescription
intexpectedTypeSize

void CheckTypeSizeAndThrow< T, U >

public static void CheckTypeSizeAndThrow< T, U >()

string FormatAddress

public static string FormatAddress(
void * ptr
)

Parameters

TypeNameDescription
void *ptr

T [] GetManagedArray< T >

public static T [] GetManagedArray< T >(
IntPtr buffer,
int length
)

Parameters

TypeNameDescription
IntPtrbuffer
intlength

T [] GetManagedArray< T >

public static T [] GetManagedArray< T >(
T * buffer,
int length
)

Parameters

TypeNameDescription
T *buffer
intlength

T * Malloc< T >

public static T * Malloc< T >(
Allocator allocator
)

Parameters

TypeNameDescription
Allocatorallocator

T * MallocTracked< T >

public static T * MallocTracked< T >(
Allocator allocator,
int callstacksToSkip =1
)

Parameters

TypeNameDescription
Allocatorallocator
intcallstacksToSkip

U * PunRefTypeUnchecked< T, U >

public static U * PunRefTypeUnchecked< T, U >(
ref T obj
)

Parameters

TypeNameDescription
ref Tobj

T * PunType< T >

public static T * PunType< T >(
void * obj,
int expectedSize
)

Parameters

TypeNameDescription
void *obj
intexpectedSize

U * PunType< T, U >

public static U * PunType< T, U >(
T * obj
)

Parameters

TypeNameDescription
T *obj

U * PunTypeUnchecked< T, U >

public static U * PunTypeUnchecked< T, U >(
T * obj
)

Parameters

TypeNameDescription
T *obj

U * PunTypeUnchecked< U >

public static U * PunTypeUnchecked< U >(
void * obj
)

Parameters

TypeNameDescription
void *obj