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

◆ WriteInt16() [4/6]

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

Definition at line 1031 of file Marshal.cs.

1032 {
1033 try
1034 {
1035 byte* ptr2 = (byte*)(void*)ptr + ofs;
1036 if (((int)ptr2 & 1) == 0)
1037 {
1038 *(short*)ptr2 = val;
1039 }
1040 else
1041 {
1042 Unsafe.WriteUnaligned(ptr2, val);
1043 }
1044 }
1045 catch (NullReferenceException)
1046 {
1047 throw new AccessViolationException();
1048 }
1049 }