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

◆ ReadInt16() [2/3]

static unsafe short System.Runtime.InteropServices.Marshal.ReadInt16 ( IntPtr ptr,
int ofs )
inlinestatic

Definition at line 932 of file Marshal.cs.

933 {
934 try
935 {
936 byte* ptr2 = (byte*)(void*)ptr + ofs;
937 if (((int)ptr2 & 1) == 0)
938 {
939 return *(short*)ptr2;
940 }
941 return Unsafe.ReadUnaligned<short>(ptr2);
942 }
943 catch (NullReferenceException)
944 {
945 throw new AccessViolationException();
946 }
947 }