@Override
  public @Nullable ByteBuffer tryAllocate(int bufferSize,
                                          boolean allowAllocateAboveCapacity) {
    //if we have >= bufferSize of free capacity -> just allocate new direct buffer:
    ByteBuffer nativeBuffer = tryReserveInNative(bufferSize);
    if (nativeBuffer != null) {
      return nativeBuffer;
    }

    if (allowAllocateAboveCapacity) {
      ByteBuffer heapBuffer = tryReserveInHeap(bufferSize);
      if (heapBuffer != null) {
        return heapBuffer;
      }
    }
    return null;
  }
@Override
  public @Nullable ByteBuffer tryAllocate(int bufferSize,
                                          boolean allowAllocateAboveCapacity)