private FileBlock GetBlock(long offset)
        {
            FileBlock result = null;
            int       num    = (int)(offset / this.m_blockSize);

            if (num < this.m_blocks.Count)
            {
                result = this.m_blocks[num];
            }
            return(result);
        }
        private long SearchBlock(long offset, long size)
        {
            long      result = -1L;
            FileBlock block  = this.GetBlock(offset);

            if (block != null)
            {
                result = block.AllocateSpace(size);
            }
            return(result);
        }
 public void TraceStats()
 {
     Global.Tracer.Trace(TraceLevel.Verbose, "LocalitySpaceManager Stats. StreamSize: {0} MB. FileBlocks:", this.m_streamEnd / 1048576);
     for (int i = 0; i < this.m_blocks.Count; i++)
     {
         FileBlock fileBlock = this.m_blocks[i];
         if (fileBlock != null)
         {
             fileBlock.TraceStats((i * this.m_blockSize / 1048576).ToString(CultureInfo.InvariantCulture));
         }
     }
 }
        private FileBlock GetOrCreateBlock(long offset)
        {
            int num = (int)(offset / this.m_blockSize);

            if (num >= this.m_blocks.Count)
            {
                for (int i = this.m_blocks.Count - 1; i < num; i++)
                {
                    this.m_blocks.Add(null);
                }
                this.m_blocks.Add(new FileBlock());
            }
            FileBlock fileBlock = this.m_blocks[num];

            if (fileBlock == null)
            {
                fileBlock          = new FileBlock();
                this.m_blocks[num] = fileBlock;
            }
            return(fileBlock);
        }
        public void Free(long offset, long size)
        {
            FileBlock orCreateBlock = this.GetOrCreateBlock(offset);

            orCreateBlock.Free(offset, size);
        }