h2/src/main/org/h2/mvstore/FreeSpaceBitSet.java
/**
     * Allocate a number of blocks and mark them as used.
     *
     * @param length the number of bytes to allocate
     * @return the start position in bytes
     */
Allocate a number of blocks and mark them as used.
@param length the number of bytes to allocate
@return the start position in bytes
Allocate a number of blocks and mark them as used . @param length the number of bytes to allocate @return the start position in bytes
public long allocate(int length) {
        int blocks = getBlockCount(length);
        for (int i = 0;;) {
            int start = set.nextClearBit(i);
            int end = set.nextSetBit(start + 1);
            if (end < 0 || end - start >= blocks) {
                set.set(start, start + blocks);
                return getPos(start);
            }
            i = end;
        }
    }
public long allocate ( int length ) { int blocks = getBlockCount ( length ) ; for ( int i = 0 ; ; ) { int start = set . nextClearBit ( i ) ; int end = set . nextSetBit ( start + 1 ) ; if ( end < 0 || end - start >= blocks ) { set . set ( start , start + blocks ) ; return getPos ( start ) ; } i = end ; } }
Allocate a number of blocks and mark them as used.
Allocate a number of blocks and mark them as used .