예제 #1
0
        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);
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
            }
        }