@Test public void testAllocate() throws Exception { ByteBuffer adr = Uns.allocate(100, true); assertNotNull(adr); Uns.free(adr); }
static ByteBuffer allocate(long bytes, boolean throwOOME) { long address = allocator.allocate(bytes); if (address != 0L) allocated(address, bytes); else { if (throwOOME) throw new OutOfMemoryError("unable to allocate " + bytes + " in off-heap"); return null; } return directBufferFor(address, bytes); }
Uns { static ByteBuffer allocate(long bytes, boolean throwOOME) { long address = allocator.allocate(bytes); if (address != 0L) allocated(address, bytes); else { if (throwOOME) throw new OutOfMemoryError("unable to allocate " + bytes + " in off-heap"); return null; } return directBufferFor(address, bytes); } }
Uns { static ByteBuffer allocate(long bytes, boolean throwOOME) { long address = allocator.allocate(bytes); if (address != 0L) allocated(address, bytes); else { if (throwOOME) throw new OutOfMemoryError("unable to allocate " + bytes + " in off-heap"); return null; } return directBufferFor(address, bytes); } private  Uns(); }
Uns { static ByteBuffer allocate(long bytes, boolean throwOOME) { long address = allocator.allocate(bytes); if (address != 0L) allocated(address, bytes); else { if (throwOOME) throw new OutOfMemoryError("unable to allocate " + bytes + " in off-heap"); return null; } return directBufferFor(address, bytes); } private  Uns();  }
Uns { static ByteBuffer allocate(long bytes, boolean throwOOME) { long address = allocator.allocate(bytes); if (address != 0L) allocated(address, bytes); else { if (throwOOME) throw new OutOfMemoryError("unable to allocate " + bytes + " in off-heap"); return null; } return directBufferFor(address, bytes); } private  Uns();   }