public void Build(int segmentSize, int blockSize, int segmentIndex, out int realBlockedMemory) { // -------- Who i am ? _blocksSize = blockSize; _segmentIndex = segmentIndex; // -------- Compute _blockCount = segmentSize / blockSize; _freeBlocks = _blockCount; _physicalBlockSize = BlockHeader.SIZE + blockSize; // -------- Allocate _blockPool = new LinkedIndexPool(_blockCount, 2); _bufferSize = _physicalBlockSize * (_blockCount + 1); _data = (byte *)Marshal.AllocHGlobal(_bufferSize).ToPointer(); realBlockedMemory = _bufferSize; }