Beispiel #1
0
 public static IntPtr MapSharedMemory(IntPtr handle, ulong size)
 {
     if (OperatingSystem.IsWindows())
     {
         return(MemoryManagementWindows.MapSharedMemory(handle));
     }
     else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
     {
         return(MemoryManagementUnix.MapSharedMemory(handle, size));
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Beispiel #2
0
 public static IntPtr MapSharedMemory(IntPtr handle)
 {
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         return(MemoryManagementWindows.MapSharedMemory(handle));
     }
     else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
              RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
     {
         return(MemoryManagementUnix.MapSharedMemory(handle));
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }