Пример #1
0
 public static void DestroySharedMemory(IntPtr handle)
 {
     if (OperatingSystem.IsWindows())
     {
         MemoryManagementWindows.DestroySharedMemory(handle);
     }
     else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
     {
         MemoryManagementUnix.DestroySharedMemory(handle);
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Пример #2
0
 public static void DestroySharedMemory(IntPtr handle)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         MemoryManagementWindows.DestroySharedMemory(handle);
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
              RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
     {
         MemoryManagementUnix.DestroySharedMemory(handle);
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }