Пример #1
0
 public static IntPtr Reserve(ulong size, bool viewCompatible)
 {
     if (OperatingSystem.IsWindows())
     {
         return(MemoryManagementWindows.Reserve((IntPtr)size, viewCompatible));
     }
     else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
     {
         return(MemoryManagementUnix.Reserve(size));
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Пример #2
0
        public static IntPtr Reserve(ulong size)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                IntPtr sizeNint = new IntPtr((long)size);

                return(MemoryManagementWindows.Reserve(sizeNint));
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||
                     RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {
                return(MemoryManagementUnix.Reserve(size));
            }
            else
            {
                throw new PlatformNotSupportedException();
            }
        }
Пример #3
0
        public static IntPtr Reserve(ulong size)
        {
            if (OperatingSystem.IsWindows())
            {
                IntPtr sizeNint = new IntPtr((long)size);

                return(MemoryManagementWindows.Reserve(sizeNint));
            }
            else if (OperatingSystem.IsLinux() ||
                     OperatingSystem.IsMacOS())
            {
                return(MemoryManagementUnix.Reserve(size));
            }
            else
            {
                throw new PlatformNotSupportedException();
            }
        }