private void Dispose(bool disposeManagedResources) { if (_view != null) { _view.Dispose(); } _view = null; }
public MemoryMappedViewAccessor CreateViewAccessor(long offset, long size, MemoryMappedFileAccess access = MemoryMappedFileAccess.ReadWrite) { if (offset < 0) throw new ArgumentOutOfRangeException("offset", "Value must be non-negative"); if (size < 0) throw new ArgumentOutOfRangeException("size", "Value must be positive or zero for default size"); if (IntPtr.Size == 4 && size > ((1024 * 1024 * 1024) * (long)4)) throw new ArgumentOutOfRangeException("size", "The capacity cannot be greater than the size of the system's logical address space."); MemoryMappedView memoryMappedView = MemoryMappedView.CreateView(this._handle, access, offset, size); return new MemoryMappedViewAccessor(memoryMappedView); }
internal MemoryMappedViewAccessor(MemoryMappedView memoryMappedView) { this._view = memoryMappedView; }