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

◆ WriteInt32() [1/3]

static unsafe void System.Runtime.InteropServices.Marshal.WriteInt32 ( IntPtr ptr,
int ofs,
int val )
inlinestatic

Definition at line 1071 of file Marshal.cs.

1072 {
1073 try
1074 {
1075 byte* ptr2 = (byte*)(void*)ptr + ofs;
1076 if (((int)ptr2 & 3) == 0)
1077 {
1078 *(int*)ptr2 = val;
1079 }
1080 else
1081 {
1082 Unsafe.WriteUnaligned(ptr2, val);
1083 }
1084 }
1085 catch (NullReferenceException)
1086 {
1087 throw new AccessViolationException();
1088 }
1089 }