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

◆ GrowPageFileIfNecessaryAndPossible()

static unsafe void System.Runtime.MemoryFailPoint.GrowPageFileIfNecessaryAndPossible ( UIntPtr numBytes)
inlinestaticprivate

Definition at line 210 of file MemoryFailPoint.cs.

211 {
212 void* ptr = Interop.Kernel32.VirtualAlloc(null, numBytes, 4096, 4);
213 if (ptr != null && !Interop.Kernel32.VirtualFree(ptr, UIntPtr.Zero, 32768))
214 {
216 }
217 }
static IntPtr VirtualAlloc(SafeHandle lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect)
static unsafe bool VirtualFree(void *lpAddress, UIntPtr dwSize, int dwFreeType)
static Exception GetExceptionForLastWin32Error(string path="")

References System.IO.Win32Marshal.GetExceptionForLastWin32Error(), Interop.Kernel32.VirtualAlloc(), Interop.Kernel32.VirtualFree(), and System.UIntPtr.Zero.

Referenced by System.Runtime.MemoryFailPoint.MemoryFailPoint().