@Test public void freeShouldReleaseDirectBufferResources() { final UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocateDirect(4)); buffer.setMemory(0, 4, (byte)111); BufferUtil.free(buffer); }
public static void free(final DirectBuffer buffer) { if (null != buffer) { free(buffer.byteBuffer()); } }
BufferUtil { public static void free(final DirectBuffer buffer) { if (null != buffer) { free(buffer.byteBuffer()); } } }
BufferUtil { public static void free(final DirectBuffer buffer) { if (null != buffer) { free(buffer.byteBuffer()); } } private  BufferUtil(); }
BufferUtil { public static void free(final DirectBuffer buffer) { if (null != buffer) { free(buffer.byteBuffer()); } } private  BufferUtil(); static void boundsCheck(final byte[] buffer, final long index, final int length); static void boundsCheck(final ByteBuffer buffer, final long index, final int length); static long address(final ByteBuffer buffer); static byte[] array(final ByteBuffer buffer); static int arrayOffset(final ByteBuffer buffer); static ByteBuffer allocateDirectAligned(final int capacity, final int alignment); static void free(final DirectBuffer buffer); static void free(final ByteBuffer buffer); }
BufferUtil { public static void free(final DirectBuffer buffer) { if (null != buffer) { free(buffer.byteBuffer()); } } private  BufferUtil(); static void boundsCheck(final byte[] buffer, final long index, final int length); static void boundsCheck(final ByteBuffer buffer, final long index, final int length); static long address(final ByteBuffer buffer); static byte[] array(final ByteBuffer buffer); static int arrayOffset(final ByteBuffer buffer); static ByteBuffer allocateDirectAligned(final int capacity, final int alignment); static void free(final DirectBuffer buffer); static void free(final ByteBuffer buffer); static final byte[] NULL_BYTES; static final ByteOrder NATIVE_BYTE_ORDER; static final long ARRAY_BASE_OFFSET; static final long BYTE_BUFFER_HB_FIELD_OFFSET; static final long BYTE_BUFFER_OFFSET_FIELD_OFFSET; static final long BYTE_BUFFER_ADDRESS_FIELD_OFFSET; }