code: @NotNull
  	public static ByteBuf allocate(int size) {
  		if (MIN_MAX_CHECKS) {
  			if ((MIN_SIZE != 0 && size < MIN_SIZE) || (MAX_SIZE != 0 && size >= MAX_SIZE)) {
  				// not willing to register in pool
  				return ByteBuf.wrapForWriting(new byte[size]);
  			}
  		}
  		int index = 32 - numberOfLeadingZeros(size - 1); // index==32 for size==0
  		ByteBufConcurrentStack stack = slabs[index];
  		ByteBuf buf = stack.pop();
  		if (buf != null) {
  			buf.reset();
  			if (STATS) recordReuse(index);
  			if (REGISTRY) register(buf);
  		} else {
  			buf = ByteBuf.wrapForWriting(new byte[1 << index]);
  			buf.refs++;
  			if (STATS) recordNew(index);
  			if (REGISTRY) register(buf);
  		}
  		return buf;
  	}
docs: Allocates byte buffer from the pool with size of
  <code>ceil(log<sub>2</sub>(size))<sup>2</sup></code>
  (rounds up to the nearest power of 2) bytes.
  <p>
  Note that resource intensive {@link #register(ByteBuf)} will be executed
  only if {@code #REGISTRY} is set {@code true}. Also, such parameters as
  {@code STATS}, {@code MIN_MAX_CHECKS}, {@code MIN_SIZE}, {@code MAX_SIZE}
  significantly influence the workflow of the {@code allocate} operation.
  
  @param size returned byte buffer size is guaranteed to be bigger or equal to requested size
  @return byte buffer from this pool