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