/// <summary> /// Free memory trampoline. /// </summary> /// <param name="address"></param> public static void FreeTrampoline(IntPtr address) { if (OSHelper.IsPosix) { Mman.munmap(address, TrampolineInstruction.Length); } else { Kernel32.VirtualFree(address, TrampolineInstruction.Length); } }
/// <summary> /// Free memory trampoline. /// </summary> /// <param name="address"></param> public static void FreeTrampoline(IntPtr address) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { Kernel32.VirtualFree(address, TrampolineInstruction.Length); } else { Mman.munmap(address, TrampolineInstruction.Length); } }