Class UnsafeUtility
  
  
  
  
    Inheritance
    
    UnsafeUtility
   
  
  
  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 Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  AlignOf<T>()
  
  
  Declaration
  
    public static int AlignOf<T>()
    where T : struct
   
  Returns
  
  Type Parameters
  
  
  
  
  CopyObjectAddressToPtr(Object, Void*)
  
  
  Declaration
  
    public static void CopyObjectAddressToPtr(object target, void *dstPtr)
   
  Parameters
  
  
    |
    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
  
  
    |
    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
  
  
  
  
  Free(Void*, Allocator)
  
  
  Declaration
  
    public static void Free(void *memory, Allocator allocator)
   
  Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetFieldOffset(FieldInfo)
  
  
  Declaration
  
    public static int GetFieldOffset(FieldInfo field)
   
  Parameters
  
  Returns
  
  
  
  
  IsBlittable(Type)
  
  
  Declaration
  
    public static bool IsBlittable(Type type)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Type | 
        type | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  IsBlittable<T>()
  
  
  Declaration
  
    public static bool IsBlittable<T>()
    where T : struct
   
  Returns
  
  Type Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  IsValidAllocator(Allocator)
  
  
  Declaration
  
    public static bool IsValidAllocator(Allocator allocator)
   
  Parameters
  
  Returns
  
  
  
  
  Malloc(Int64, Int32, Allocator)
  
  
  Declaration
  
    public static void *Malloc(long size, int alignment, Allocator allocator)
   
  Parameters
  
  Returns
  
  
  
  
  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
  
  Returns
  
  
  
  
  MemCpy(Void*, Void*, Int64)
  
  
  Declaration
  
    public static void MemCpy(void *destination, void *source, long size)
   
  Parameters
  
  
  
  
  MemCpyReplicate(Void*, Void*, Int32, Int32)
  
  
  Declaration
  
    public static void MemCpyReplicate(void *destination, void *source, int size, int count)
   
  Parameters
  
  
  
  
  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
  
  
  
  
  MemMove(Void*, Void*, Int64)
  
  
  Declaration
  
    public static void MemMove(void *destination, void *source, long size)
   
  Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  PinGCArrayAndGetDataAddress(Array, out UInt64)
  
  
  Declaration
  
    public static void *PinGCArrayAndGetDataAddress(Array target, out ulong gcHandle)
   
  Parameters
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  PinGCObjectAndGetAddress(Object, out UInt64)
  
  
  Declaration
  
    public static void *PinGCObjectAndGetAddress(object target, out ulong gcHandle)
   
  Parameters
  
  Returns
  
  
    |
    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 Parameters
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ReadArrayElementWithStride<T>(Void*, Int32, Int32)
  
  
  Declaration
  
    public static T ReadArrayElementWithStride<T>(void *source, int index, int stride)
   
  Parameters
  
  Returns
  
  Type Parameters
  
  
  
  
  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
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  SizeOf<T>()
  
  
  Declaration
  
    public static int SizeOf<T>()
    where T : struct
   
  Returns
  
  Type Parameters
  
  
    |
    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
  
  
    |
    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