On 10/12/2016 17:11, Chris Hegarty wrote:
:

How about: Unsafe::deallocate(ByteBuffer directBuffer)?
   http://cr.openjdk.java.net/~chegar/Unsafe_deallocate/

The alternative is of course:

ByteBuffer wrap(long address, int capacity)
void unmap(MappedByteBuffer)

The wrap method allow be similar to JNI's NewDirectByteBuffer for those that are managing the underlying memory themselves. This makes it a more advanced method to avoid too much temptation to free the memory underlying a buffer created with ByteBuffer.allocateDirect. We can't do much with unmap but that at least won't be widely used.

-Alan.

Reply via email to