Files
Dec2017-Script-Dump/UnityEngine/UnsafeUtility.cs
T
2026-06-04 11:42:34 +02:00

73 lines
2.2 KiB
C#

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Collections;
namespace UnityEngine
{
// Token: 0x020004FB RID: 1275
internal static class UnsafeUtility
{
// Token: 0x06003C49 RID: 15433 RVA: 0x0006A97C File Offset: 0x00068B7C
public unsafe static void CopyPtrToStructure<T>(IntPtr ptr, out T output) where T : struct
{
output = *ptr;
}
// Token: 0x06003C4A RID: 15434 RVA: 0x0006A98C File Offset: 0x00068B8C
public unsafe static void CopyStructureToPtr<T>(ref T output, IntPtr ptr) where T : struct
{
*ptr = output;
}
// Token: 0x06003C4B RID: 15435 RVA: 0x0006A99C File Offset: 0x00068B9C
public unsafe static T ReadArrayElement<T>(IntPtr source, int index)
{
return *(source + (IntPtr)index);
}
// Token: 0x06003C4C RID: 15436 RVA: 0x0006A9A8 File Offset: 0x00068BA8
public unsafe static void WriteArrayElement<T>(IntPtr destination, int index, T value)
{
*(destination + (IntPtr)index) = value;
}
// Token: 0x06003C4D RID: 15437 RVA: 0x0006A9B4 File Offset: 0x00068BB4
public static IntPtr AddressOf<T>(ref T output) where T : struct
{
return ref output;
}
// Token: 0x06003C4E RID: 15438 RVA: 0x0006A9B8 File Offset: 0x00068BB8
public static int SizeOf<T>() where T : struct
{
return UnsafeUtility.SizeOfStruct(typeof(T));
}
// Token: 0x06003C4F RID: 15439 RVA: 0x0006A9DC File Offset: 0x00068BDC
public static int AlignOf<T>() where T : struct
{
return 4;
}
// Token: 0x06003C50 RID: 15440
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern IntPtr Malloc(int size, int alignment, Allocator label);
// Token: 0x06003C51 RID: 15441
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void Free(IntPtr memory, Allocator label);
// Token: 0x06003C52 RID: 15442
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void MemCpy(IntPtr destination, IntPtr source, int size);
// Token: 0x06003C53 RID: 15443
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern int SizeOfStruct(Type type);
// Token: 0x06003C54 RID: 15444
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void LogError(string msg, string filename, int linenumber);
}
}