Exemple #1
0
 public static void MapView(IntPtr sharedMemory, ulong srcOffset, IntPtr address, ulong size, MemoryBlock owner)
 {
     if (OperatingSystem.IsWindows())
     {
         MemoryManagementWindows.MapView(sharedMemory, srcOffset, address, (IntPtr)size, owner);
     }
     else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
     {
         MemoryManagementUnix.MapView(sharedMemory, srcOffset, address, size);
     }
     else
     {
         throw new PlatformNotSupportedException();
     }
 }
Exemple #2
0
        public static void MapView(IntPtr sharedMemory, ulong srcOffset, IntPtr address, ulong size, bool force4KBMap)
        {
            if (OperatingSystem.IsWindows())
            {
                IntPtr sizeNint = new IntPtr((long)size);

                if (force4KBMap)
                {
                    MemoryManagementWindows.MapView4KB(sharedMemory, srcOffset, address, sizeNint);
                }
                else
                {
                    MemoryManagementWindows.MapView(sharedMemory, srcOffset, address, sizeNint);
                }
            }
            else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
            {
                MemoryManagementUnix.MapView(sharedMemory, srcOffset, address, size);
            }
            else
            {
                throw new PlatformNotSupportedException();
            }
        }