public static void UnmapView(IntPtr sharedMemory, IntPtr address, ulong size, MemoryBlock owner) { if (OperatingSystem.IsWindows()) { MemoryManagementWindows.UnmapView(sharedMemory, address, (IntPtr)size, owner); } else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) { MemoryManagementUnix.UnmapView(address, size); } else { throw new PlatformNotSupportedException(); } }
public static void UnmapView(IntPtr sharedMemory, IntPtr address, ulong size, bool force4KBMap) { if (OperatingSystem.IsWindows()) { IntPtr sizeNint = new IntPtr((long)size); if (force4KBMap) { MemoryManagementWindows.UnmapView4KB(address, sizeNint); } else { MemoryManagementWindows.UnmapView(sharedMemory, address, sizeNint); } } else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) { MemoryManagementUnix.UnmapView(address, size); } else { throw new PlatformNotSupportedException(); } }