/** * Allocates a native {@code float} array of the given size. * * @param size the number of {@code float} elements to allocate */ public FloatPointer(long size) { try { allocateArray(size); if (size > 0 && address == 0) { throw new OutOfMemoryError("Native allocator returned address == 0"); } } catch (UnsatisfiedLinkError e) { throw new RuntimeException("No native JavaCPP library in memory. (Has Loader.load() been called?)", e); } catch (OutOfMemoryError e) { OutOfMemoryError e2 = new OutOfMemoryError("Cannot allocate new FloatPointer(" + size + "): " + "totalBytes = " + formatBytes(totalBytes()) + ", physicalBytes = " + formatBytes(physicalBytes())); e2.initCause(e); throw e2; } } /** @see Pointer#Pointer() */