public static MemoryMappedFileSegmentFactory Open(MemoryMappedFile file, long offset = 0, long length = -1, MemoryMappedFileAccess access = MemoryMappedFileAccess.Read, int defaultSegmentWords = DefaultSegmentWords, bool leaveOpen = false) { MemoryMappedFileSegmentFactory obj = null; try { obj = Cache <MemoryMappedFileSegmentFactory> .Pop() ?? new MemoryMappedFileSegmentFactory(); obj.Init(file, offset, length, access, defaultSegmentWords, leaveOpen); var tmp = obj; obj = null; // to avoid finally return(tmp); } finally { Cache <MemoryMappedFileSegmentFactory> .Push(obj); } }
public static MemoryMappedFileSegmentFactory Open(string path, long offset = 0, long length = -1, MemoryMappedFileAccess access = MemoryMappedFileAccess.Read, int defaultSegmentWords = DefaultSegmentWords) { MemoryMappedFileSegmentFactory obj = null; try { obj = Cache <MemoryMappedFileSegmentFactory> .Pop() ?? new MemoryMappedFileSegmentFactory(); obj.Init(path, 0, length, FileMode.Open, access, defaultSegmentWords); var tmp = obj; obj = null; // to avoid finally return(tmp); } finally { Cache <MemoryMappedFileSegmentFactory> .Push(obj); } }
public void Dispose() { Cache <Message> .Push(this); }
void IDisposable.Dispose() { Cache <Textizer> .Push(this); }
public override void Dispose() { Cache <MemoryMappedFileSegmentFactory> .Push(this); }
public override void Dispose() { Cache <BufferedStreamSegmentFactory> .Push(this); }
public override void Dispose() { Cache <PointerSegment> .Push(this); }
void IDisposable.Dispose() { Cache <BufferSegmentFactory> .Push(this); }