public MemoryMappedFileArena(MemoryMappedFileManager manager, List <MemoryMappedFileArena> containingList, int allocationSize) { Contract.Assert(containingList.Count == 0, "should only create a new arena when the containing list is empty"); _manager = manager; _containingList = containingList; _memoryMappedFile = MemoryMappedFile.CreateNew(MemoryMappedFileManager.CreateUniqueName(allocationSize), MemoryMappedFileArenaSize, MemoryMappedFileAccess.ReadWrite); _freeSegmentOffsets = new Stack <long>(Enumerable.Range(0, MemoryMappedFileArenaSize / allocationSize).Select(x => (long)x * allocationSize)); _segmentCount = _freeSegmentOffsets.Count; }
public MemoryMappedFileArena(MemoryMappedFileManager manager, List<MemoryMappedFileArena> containingList, int allocationSize) { Contract.Assert(containingList.Count == 0, "should only create a new arena when the containing list is empty"); _manager = manager; _containingList = containingList; _memoryMappedFile = MemoryMappedFile.CreateNew(MemoryMappedFileManager.CreateUniqueName(allocationSize), MemoryMappedFileArenaSize, MemoryMappedFileAccess.ReadWrite); _freeSegmentOffsets = new Stack<long>(Enumerable.Range(0, MemoryMappedFileArenaSize / allocationSize).Select(x => (long)x * allocationSize)); _segmentCount = _freeSegmentOffsets.Count; }