Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ReadInt32() [2/3]

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

Definition at line 954 of file Marshal.cs.

955 {
956 try
957 {
958 byte* ptr2 = (byte*)(void*)ptr + ofs;
959 if (((int)ptr2 & 3) == 0)
960 {
961 return *(int*)ptr2;
962 }
963 return Unsafe.ReadUnaligned<int>(ptr2);
964 }
965 catch (NullReferenceException)
966 {
967 throw new AccessViolationException();
968 }
969 }