private void removeBlock(Chunk chunk, int blocksize, long block) throws IndexException { assert this.fExclusiveLock; long prevblock = chunk.getFreeRecPtr(block + BLOCK_PREV_OFFSET); long nextblock = chunk.getFreeRecPtr(block + BLOCK_NEXT_OFFSET); if (prevblock != 0) { putFreeRecPtr(prevblock + BLOCK_NEXT_OFFSET, nextblock); } else { // We were the head. setFirstBlock(blocksize, nextblock); } if (nextblock != 0) putFreeRecPtr(nextblock + BLOCK_PREV_OFFSET, prevblock); }
private void removeBlock(Chunk chunk, int blocksize, long block) throws IndexException { assert this.fExclusiveLock; long prevblock = chunk.getFreeRecPtr(block + BLOCK_PREV_OFFSET); long nextblock = chunk.getFreeRecPtr(block + BLOCK_NEXT_OFFSET); if (prevblock != 0) { putFreeRecPtr(prevblock + BLOCK_NEXT_OFFSET, nextblock); } else { // We were the head. setFirstBlock(blocksize, nextblock); } if (nextblock != 0) putFreeRecPtr(nextblock + BLOCK_PREV_OFFSET, prevblock); }
private void addBlock(Chunk chunk, int blocksize, long block) throws IndexException { assert this.fExclusiveLock; // Mark our size chunk.putShort(block, (short) blocksize); // Add us to the head of the list. long prevfirst = getFirstBlock(blocksize); chunk.putFreeRecPtr(block + BLOCK_PREV_OFFSET, 0); chunk.putFreeRecPtr(block + BLOCK_NEXT_OFFSET, prevfirst); if (prevfirst != 0) putFreeRecPtr(prevfirst + BLOCK_PREV_OFFSET, block); setFirstBlock(blocksize, block); }
private void addBlock(Chunk chunk, int blocksize, long block) throws IndexException { assert this.fExclusiveLock; // Mark our size chunk.putShort(block, (short) blocksize); // Add us to the head of the list. long prevfirst = getFirstBlock(blocksize); chunk.putFreeRecPtr(block + BLOCK_PREV_OFFSET, 0); chunk.putFreeRecPtr(block + BLOCK_NEXT_OFFSET, prevfirst); if (prevfirst != 0) putFreeRecPtr(prevfirst + BLOCK_PREV_OFFSET, block); setFirstBlock(blocksize, block); }