Example #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();
     }
 }
Example #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();
            }
        }
Example #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();
            }
        }