void Allocate(string sharedMemName, bool useExistingSharedMemory, long numItems, bool largePages) { if (SoftwareManager.IsLinux) { if (UseIncrementalAlloc) { rawMemoryManager = new RawMemoryManagerIncrementalLinux <T>() as IRawMemoryManagerIncremental <T>; } else { throw new Exception("Only UseIncrementalAlloc mode supported under Linux"); } } else { if (UseIncrementalAlloc) { rawMemoryManager = new RawMemoryManagerIncrementalWindows <T>() as IRawMemoryManagerIncremental <T>; } else { rawMemoryManager = new WRawMemoryManagerPreallocatedWindows <T>() as IRawMemoryManagerIncremental <T>; } } rawMemoryManager.Reserve(sharedMemName, useExistingSharedMemory, numItems, largePages); rawMemoryAddress = rawMemoryManager.RawMemoryAddress; }
public ArrayStructsIncrementalPinned(int maxItems, bool useLargePages = false) { if (SoftwareManager.IsLinux) { rawMemoryManager = new RawMemoryManagerIncrementalLinux <T>(); } else { rawMemoryManager = new RawMemoryManagerIncrementalWindows <T>(); } rawMemoryManager.Reserve(null, false, maxItems, useLargePages); }