public static void UnmapSharedMemory(IntPtr address, ulong size) { if (OperatingSystem.IsWindows()) { MemoryManagementWindows.UnmapSharedMemory(address); } else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) { MemoryManagementUnix.UnmapSharedMemory(address, size); } else { throw new PlatformNotSupportedException(); } }
public static void UnmapSharedMemory(IntPtr address) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { MemoryManagementWindows.UnmapSharedMemory(address); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { MemoryManagementUnix.UnmapSharedMemory(address); } else { throw new PlatformNotSupportedException(); } }