/** * Creates a new int slice with the given starting size and returns the slices offset in the pool. * @see SliceReader */ private int newSlice(final int size) { if (intUpto > INT_BLOCK_SIZE-size) { nextBuffer(); assert assertSliceBuffer(buffer); } final int upto = intUpto; intUpto += size; buffer[intUpto-1] = 1; return upto; }
/** * Allocates a new slice from the given offset */ private int allocSlice(final int[] slice, final int sliceOffset) { final int level = slice[sliceOffset]; final int newLevel = NEXT_LEVEL_ARRAY[level-1]; final int newSize = LEVEL_SIZE_ARRAY[newLevel]; // Maybe allocate another block if (intUpto > INT_BLOCK_SIZE-newSize) { nextBuffer(); assert assertSliceBuffer(buffer); } final int newUpto = intUpto; final int offset = newUpto + intOffset; intUpto += newSize; // Write forwarding address at end of last slice: slice[sliceOffset] = offset; // Write new level: buffer[intUpto-1] = newLevel; return newUpto; }
/** * Creates a new int slice with the given starting size and returns the slices offset in the pool. * @see SliceReader */ private int newSlice(final int size) { if (intUpto > INT_BLOCK_SIZE-size) { nextBuffer(); assert assertSliceBuffer(buffer); } final int upto = intUpto; intUpto += size; buffer[intUpto-1] = 1; return upto; }
/** * Creates a new int slice with the given starting size and returns the slices offset in the pool. * @see SliceReader */ private int newSlice(final int size) { if (intUpto > INT_BLOCK_SIZE-size) { nextBuffer(); assert assertSliceBuffer(buffer); } final int upto = intUpto; intUpto += size; buffer[intUpto-1] = 1; return upto; }
/** * Creates a new int slice with the given starting size and returns the slices offset in the pool. * @see SliceReader */ private int newSlice(final int size) { if (intUpto > INT_BLOCK_SIZE-size) { nextBuffer(); assert assertSliceBuffer(buffer); } final int upto = intUpto; intUpto += size; buffer[intUpto-1] = 1; return upto; }
/** * Allocates a new slice from the given offset */ private int allocSlice(final int[] slice, final int sliceOffset) { final int level = slice[sliceOffset]; final int newLevel = NEXT_LEVEL_ARRAY[level-1]; final int newSize = LEVEL_SIZE_ARRAY[newLevel]; // Maybe allocate another block if (intUpto > INT_BLOCK_SIZE-newSize) { nextBuffer(); assert assertSliceBuffer(buffer); } final int newUpto = intUpto; final int offset = newUpto + intOffset; intUpto += newSize; // Write forwarding address at end of last slice: slice[sliceOffset] = offset; // Write new level: buffer[intUpto-1] = newLevel; return newUpto; }
/** * Allocates a new slice from the given offset */ private int allocSlice(final int[] slice, final int sliceOffset) { final int level = slice[sliceOffset]; final int newLevel = NEXT_LEVEL_ARRAY[level-1]; final int newSize = LEVEL_SIZE_ARRAY[newLevel]; // Maybe allocate another block if (intUpto > INT_BLOCK_SIZE-newSize) { nextBuffer(); assert assertSliceBuffer(buffer); } final int newUpto = intUpto; final int offset = newUpto + intOffset; intUpto += newSize; // Write forwarding address at end of last slice: slice[sliceOffset] = offset; // Write new level: buffer[intUpto-1] = newLevel; return newUpto; }
/** * Allocates a new slice from the given offset */ private int allocSlice(final int[] slice, final int sliceOffset) { final int level = slice[sliceOffset]; final int newLevel = NEXT_LEVEL_ARRAY[level-1]; final int newSize = LEVEL_SIZE_ARRAY[newLevel]; // Maybe allocate another block if (intUpto > INT_BLOCK_SIZE-newSize) { nextBuffer(); assert assertSliceBuffer(buffer); } final int newUpto = intUpto; final int offset = newUpto + intOffset; intUpto += newSize; // Write forwarding address at end of last slice: slice[sliceOffset] = offset; // Write new level: buffer[intUpto-1] = newLevel; return newUpto; }