Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 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();
     }
 }