UnsafeUtilityEx
NameSpace: Unsafe
Public Methods
T * Calloc< T >
public static T * Calloc< T >(
Allocator allocator,
T initialValue =default
)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | |
T | initialValue |
T * CallocTracked< T >
public static T * CallocTracked< T >(
Allocator allocator,
T initialValue =default,
int callstacksToSkip =1
)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | |
T | initialValue | |
int | callstacksToSkip |
void CheckTypeSizeAndThrow< T >
public static void CheckTypeSizeAndThrow< T >(
int expectedTypeSize
)
Parameters
Type | Name | Description |
---|---|---|
int | expectedTypeSize |
void CheckTypeSizeAndThrow< T, U >
public static void CheckTypeSizeAndThrow< T, U >()
string FormatAddress
public static string FormatAddress(
void * ptr
)
Parameters
Type | Name | Description |
---|---|---|
void * | ptr |
T [] GetManagedArray< T >
public static T [] GetManagedArray< T >(
IntPtr buffer,
int length
)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | buffer | |
int | length |
T [] GetManagedArray< T >
public static T [] GetManagedArray< T >(
T * buffer,
int length
)
Parameters
Type | Name | Description |
---|---|---|
T * | buffer | |
int | length |
T * Malloc< T >
public static T * Malloc< T >(
Allocator allocator
)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator |
T * MallocTracked< T >
public static T * MallocTracked< T >(
Allocator allocator,
int callstacksToSkip =1
)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | |
int | callstacksToSkip |
U * PunRefTypeUnchecked< T, U >
public static U * PunRefTypeUnchecked< T, U >(
ref T obj
)
Parameters
Type | Name | Description |
---|---|---|
ref T | obj |
T * PunType< T >
public static T * PunType< T >(
void * obj,
int expectedSize
)
Parameters
Type | Name | Description |
---|---|---|
void * | obj | |
int | expectedSize |
U * PunType< T, U >
public static U * PunType< T, U >(
T * obj
)
Parameters
Type | Name | Description |
---|---|---|
T * | obj |
U * PunTypeUnchecked< T, U >
public static U * PunTypeUnchecked< T, U >(
T * obj
)
Parameters
Type | Name | Description |
---|---|---|
T * | obj |
U * PunTypeUnchecked< U >
public static U * PunTypeUnchecked< U >(
void * obj
)
Parameters
Type | Name | Description |
---|---|---|
void * | obj |