nl_tokens: When re - using an instance with reset it will adjust slab size based on previous data size . The intent is to reuse the same instance for the same type of data ( for example the same column ) . The assumption is that the size in the buffer will be consistent .
pl_tokens: public void reset ( ) { // readjust slab size. // 7 = 2^3 - 1 so that doubling the initial size 3 times will get to the same size this . initialSlabSize = <mask> ( bytesUsed / 7 , initialSlabSize ) ; LOG . debug ( "initial slab of size {}" , initialSlabSize ) ; for ( ByteBuffer slab : slabs ) { allocator . release ( slab ) ; } this . slabs . clear ( ) ; this . bytesAllocated = 0 ; this . bytesUsed = 0 ; this . currentSlab = EMPTY_SLAB ; this . currentSlabIndex = 0 ; }