Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ UnsafeAddrOfPinnedArrayElement< T >()

static unsafe IntPtr System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement< T > ( T[] arr,
int index )
inlinestatic

Definition at line 785 of file Marshal.cs.

786 {
787 if (arr == null)
788 {
789 throw new ArgumentNullException("arr");
790 }
791 void* ptr = Unsafe.AsPointer(ref MemoryMarshal.GetArrayDataReference(arr));
792 return (IntPtr)((byte*)ptr + (nuint)((nint)(uint)index * (nint)Unsafe.SizeOf<T>()));
793 }

References System.Runtime.InteropServices.MemoryMarshal.GetArrayDataReference(), and System.index.