public void Free(IntPtr lr) { LRUShort ls = new LRUShort(lr); if (submmfs.ContainsKey(ls.low)) { FreeSubMMF(ls.low); } else if (ls.low == mmfId && inUse.ContainsKey(ls.high)) { freeSpace += inUse[ls.high]; inUse.Remove(ls.high); } }
public BinaryWriter GetWriter(IntPtr lr) { LRUShort ls = new LRUShort(lr); if (submmfs.ContainsKey(ls.low)) { return(new BinaryWriter(submmfs[ls.low].CreateViewStream(sizeofLong, 0))); } else if (ls.low == mmfId && inUse.ContainsKey(ls.high)) { return(new BinaryWriter(mmf.CreateViewStream(ls.high + sizeofLong, inUse[ls.high] - sizeofLong))); } else { throw new System.ArgumentException(); } }
public MemoryMappedViewAccessor GetAccessor(IntPtr lr) { LRUShort ls = new LRUShort(lr); if (submmfs.ContainsKey(ls.low)) { return(submmfs[ls.low].CreateViewAccessor(sizeofLong, 0)); } else if (ls.low == mmfId && inUse.ContainsKey(ls.high)) { return(mmf.CreateViewAccessor(ls.high + sizeofLong, inUse[ls.high] - sizeofLong)); } else { throw new System.ArgumentException(); } }