@Test public void testDeallocator() throws InterruptedException { System.out.println("Deallocator"); final boolean[] failed = { false }; ExecutorService pool = Executors.newFixedThreadPool(24); for (int i = 0; i < 24; i++) { pool.execute(new Runnable() { @Override public void run() { try { for (int i = 0; i < 2000; i++) { new BytePointer(2000000); } } catch (OutOfMemoryError e) { failed[0] = true; fail(e.getMessage()); } } }); } pool.shutdown(); pool.awaitTermination(1, TimeUnit.MINUTES); if (failed[0]) { fail("OutOfMemoryError should not have been thrown."); } }
protected Deallocator deallocator() { return deallocator; }
Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } }
Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } Pointer();  Pointer(final Pointer p);  Pointer(final Buffer b); }
Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } Pointer();  Pointer(final Pointer p);  Pointer(final Buffer b); static String formatBytes(long bytes); static long parseBytes(String string); static void deallocateReferences(); static long maxBytes(); static long totalBytes(); static long maxPhysicalBytes(); @Name("JavaCPP_physicalBytes") static synchronized native long physicalBytes(); @Name("JavaCPP_totalPhysicalBytes") static native long totalPhysicalBytes(); @Name("JavaCPP_availablePhysicalBytes") static native long availablePhysicalBytes(); boolean isNull(); void setNull(); long address(); long position(); P position(long position); long limit(); P limit(long limit); long capacity(); P capacity(long capacity); @Override void close(); void deallocate(); void deallocate(boolean deallocate); int offsetof(String member); int sizeof(); ByteBuffer asByteBuffer(); Buffer asBuffer(); static native Pointer malloc(long size); static native Pointer calloc(long n, long size); static native Pointer realloc(Pointer p, long size); static native void free(Pointer p); static native Pointer memchr(Pointer p, int ch, long size); static native int memcmp(Pointer p1, Pointer p2, long size); static native Pointer memcpy(Pointer dst, Pointer src, long size); static native Pointer memmove(Pointer dst, Pointer src, long size); static native Pointer memset(Pointer dst, int ch, long size); P put(Pointer p); P fill(int b); P zero(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
Pointer implements AutoCloseable { protected Deallocator deallocator() { return deallocator; } Pointer();  Pointer(final Pointer p);  Pointer(final Buffer b); static String formatBytes(long bytes); static long parseBytes(String string); static void deallocateReferences(); static long maxBytes(); static long totalBytes(); static long maxPhysicalBytes(); @Name("JavaCPP_physicalBytes") static synchronized native long physicalBytes(); @Name("JavaCPP_totalPhysicalBytes") static native long totalPhysicalBytes(); @Name("JavaCPP_availablePhysicalBytes") static native long availablePhysicalBytes(); boolean isNull(); void setNull(); long address(); long position(); P position(long position); long limit(); P limit(long limit); long capacity(); P capacity(long capacity); @Override void close(); void deallocate(); void deallocate(boolean deallocate); int offsetof(String member); int sizeof(); ByteBuffer asByteBuffer(); Buffer asBuffer(); static native Pointer malloc(long size); static native Pointer calloc(long n, long size); static native Pointer realloc(Pointer p, long size); static native void free(Pointer p); static native Pointer memchr(Pointer p, int ch, long size); static native int memcmp(Pointer p1, Pointer p2, long size); static native Pointer memcpy(Pointer dst, Pointer src, long size); static native Pointer memmove(Pointer dst, Pointer src, long size); static native Pointer memset(Pointer dst, int ch, long size); P put(Pointer p); P fill(int b); P zero(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }