Show / Hide Table of Contents

Class UnsafeUtility

Inheritance
Object
UnsafeUtility
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Unity.Collections.LowLevel.Unsafe
Assembly: UnityEngine.dll
Syntax
public static class UnsafeUtility

Methods

| Improve this Doc View Source

AddressOf<T>(ref T)

Declaration
public static void *AddressOf<T>(ref T output)
    where T : struct
Parameters
Type Name Description
T output
Returns
Type Description
Void*
Type Parameters
Name Description
T
| Improve this Doc View Source

AlignOf<T>()

Declaration
public static int AlignOf<T>()
    where T : struct
Returns
Type Description
Int32
Type Parameters
Name Description
T

CopyObjectAddressToPtr(Object, Void*)

Declaration
public static void CopyObjectAddressToPtr(object target, void *dstPtr)
Parameters
Type Name Description
Object target
Void* dstPtr
| Improve this Doc View Source

CopyPtrToStructure<T>(Void*, out T)

Declaration
public static void CopyPtrToStructure<T>(void *ptr, out T output)
    where T : struct
Parameters
Type Name Description
Void* ptr
T output
Type Parameters
Name Description
T
| Improve this Doc View Source

CopyStructureToPtr<T>(ref T, Void*)

Declaration
public static void CopyStructureToPtr<T>(ref T input, void *ptr)
    where T : struct
Parameters
Type Name Description
T input
Void* ptr
Type Parameters
Name Description
T

Free(Void*, Allocator)

Declaration
public static void Free(void *memory, Allocator allocator)
Parameters
Type Name Description
Void* memory
Allocator allocator
| Improve this Doc View Source

GetFieldOffset(FieldInfo)

Declaration
public static int GetFieldOffset(FieldInfo field)
Parameters
Type Name Description
FieldInfo field
Returns
Type Description
Int32

IsBlittable(Type)

Declaration
public static bool IsBlittable(Type type)
Parameters
Type Name Description
Type type
Returns
Type Description
Boolean
| Improve this Doc View Source

IsBlittable<T>()

Declaration
public static bool IsBlittable<T>()
    where T : struct
Returns
Type Description
Boolean
Type Parameters
Name Description
T
| Improve this Doc View Source

IsValidAllocator(Allocator)

Declaration
public static bool IsValidAllocator(Allocator allocator)
Parameters
Type Name Description
Allocator allocator
Returns
Type Description
Boolean

Malloc(Int64, Int32, Allocator)

Declaration
public static void *Malloc(long size, int alignment, Allocator allocator)
Parameters
Type Name Description
Int64 size
Int32 alignment
Allocator allocator
Returns
Type Description
Void*

MemClear(Void*, Int64)

Declaration
public static void MemClear(void *destination, long size)
Parameters
Type Name Description
Void* destination
Int64 size

MemCmp(Void*, Void*, Int64)

Declaration
public static int MemCmp(void *ptr1, void *ptr2, long size)
Parameters
Type Name Description
Void* ptr1
Void* ptr2
Int64 size
Returns
Type Description
Int32

MemCpy(Void*, Void*, Int64)

Declaration
public static void MemCpy(void *destination, void *source, long size)
Parameters
Type Name Description
Void* destination
Void* source
Int64 size

MemCpyReplicate(Void*, Void*, Int32, Int32)

Declaration
public static void MemCpyReplicate(void *destination, void *source, int size, int count)
Parameters
Type Name Description
Void* destination
Void* source
Int32 size
Int32 count

MemCpyStride(Void*, Int32, Void*, Int32, Int32, Int32)

Declaration
public static void MemCpyStride(void *destination, int destinationStride, void *source, int sourceStride, int elementSize, int count)
Parameters
Type Name Description
Void* destination
Int32 destinationStride
Void* source
Int32 sourceStride
Int32 elementSize
Int32 count

MemMove(Void*, Void*, Int64)

Declaration
public static void MemMove(void *destination, void *source, long size)
Parameters
Type Name Description
Void* destination
Void* source
Int64 size
| Improve this Doc View Source

PinGCArrayAndGetDataAddress(Array, out UInt64)

Declaration
public static void *PinGCArrayAndGetDataAddress(Array target, out ulong gcHandle)
Parameters
Type Name Description
Array target
UInt64 gcHandle
Returns
Type Description
Void*
| Improve this Doc View Source

PinGCObjectAndGetAddress(Object, out UInt64)

Declaration
public static void *PinGCObjectAndGetAddress(object target, out ulong gcHandle)
Parameters
Type Name Description
Object target
UInt64 gcHandle
Returns
Type Description
Void*
| Improve this Doc View Source

ReadArrayElement<T>(Void*, Int32)

Declaration
public static T ReadArrayElement<T>(void *source, int index)
Parameters
Type Name Description
Void* source
Int32 index
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

ReadArrayElementWithStride<T>(Void*, Int32, Int32)

Declaration
public static T ReadArrayElementWithStride<T>(void *source, int index, int stride)
Parameters
Type Name Description
Void* source
Int32 index
Int32 stride
Returns
Type Description
T
Type Parameters
Name Description
T

ReleaseGCObject(UInt64)

Declaration
public static void ReleaseGCObject(ulong gcHandle)
Parameters
Type Name Description
UInt64 gcHandle

SizeOf(Type)

Declaration
public static int SizeOf(Type type)
Parameters
Type Name Description
Type type
Returns
Type Description
Int32
| Improve this Doc View Source

SizeOf<T>()

Declaration
public static int SizeOf<T>()
    where T : struct
Returns
Type Description
Int32
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteArrayElement<T>(Void*, Int32, T)

Declaration
public static void WriteArrayElement<T>(void *destination, int index, T value)
Parameters
Type Name Description
Void* destination
Int32 index
T value
Type Parameters
Name Description
T
| Improve this Doc View Source

WriteArrayElementWithStride<T>(Void*, Int32, Int32, T)

Declaration
public static void WriteArrayElementWithStride<T>(void *destination, int index, int stride, T value)
Parameters
Type Name Description
Void* destination
Int32 index
Int32 stride
T value
Type Parameters
Name Description
T
  • Improve this Doc
  • View Source
Back to top Generated by DocFX