3435363738394041424344
} private static void unmap(MappedByteBuffer bb) { Cleaner cl = ((DirectBuffer) bb).cleaner(); if (cl != null) cl.clean(); } public long index() { return index; }
122123124125126127128129130131132
private void unmapBuffer(MappedByteBuffer b) { if(b!=null){ Cleaner cleaner = ((sun.nio.ch.DirectBuffer) b).cleaner(); if(cleaner!=null) cleaner.clean(); } } public ByteBuffer read(long pageNumber) throws IOException { FileChannel f = getChannel(pageNumber);
129130131132133134135136137138139
cleaner = (Cleaner) getObject(buffer, CLEANER_FIELD_OFFSET); if (cleaner == null) { throw new IllegalArgumentException( "attempted to deallocate the buffer which was allocated via JNIEnv->NewDirectByteBuffer()"); } cleaner.clean(); } catch (Throwable t) { // Nothing we can do here. } }
90919293949596979899100
return AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { try { Cleaner cleaner = ((DirectBuffer)buffer).cleaner(); if (cleaner != null) cleaner.clean(); // Already cleaned otherwise return null; } catch (Exception e) { return buffer; }
350351352353354355356357358359360
if (byteBuffer.isDirect()) { ((MappedByteBuffer) byteBuffer).force(); final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer) .cleaner(); if (cleaner != null) { cleaner.clean(); } } else { writeByteBuffer(byteBuffer, index); } } else {
360361362363364365366367368369370
} else { if (byteBuffer.isDirect()) { final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer) .cleaner(); if (cleaner != null) { cleaner.clean(); } } } } catch (Exception exception) { String fileSize;
722723724725726727728729730731732
} private static void unmap(MappedByteBuffer bb) { Cleaner cl = ((DirectBuffer)bb).cleaner(); if (cl != null) cl.clean(); } private static final int MAP_RO = 0; private static final int MAP_RW = 1; private static final int MAP_PV = 2;
551552553554555556557558559560561