Login  Register

Re: JOGL 2.3.1 on armv6hf

Posted by Sven Gothel on Jul 16, 2015; 1:58am
URL: https://forum.jogamp.org/JOGL-2-3-1-on-armv6hf-tp4034766p4034906.html

On 07/09/2015 05:03 PM, Xerxes Rånby [via jogamp] wrote:

>     gouessej wrote
>     Good job. I like the solution "C" because there is no support of capacity
>     expressed with a long in the current Java SE API and under Android.
>     However, the maximum capacity is Integer.MAX_VALUE, i.e 2 GiB
>     <https://en.wikipedia.org/wiki/Gibibyte>.
>
> Yes it is a misfortunate API decision in java to use signed ints, it limits
> the max capacity of Direct ByteBuffer's to 2GB.
> There has been filed enhancement bugs since 2001 to fix it
> https://bugs.openjdk.java.net/browse/JDK-4496703 - (bf) Buffer classes limited
> by 32-bit addressing
> but it has been ignored.
>
> While investigating i found that there exist one alternative way to create a
> direct ByteBuffers using the MappedByteBuffer class. MappedByteBuffer is using
> mmap internally thus it should not have any size limitation. Unfortunally the
> implementation of MappedByteBuffer has added a fictive limitation of 2Gb here
> as well.
> https://bugs.openjdk.java.net/browse/JDK-6347833 - (fs) Enhance
> MappedByteBuffer to support sizes >2GB on 64 bit platforms.
GlueGen supports mapped buffers > 2GiB
via slicing, see:

MappedByteBufferInputStream

<http://jogamp.org/deployment/jogamp-next/javadoc/gluegen/javadoc/com/jogamp/common/nio/MappedByteBufferInputStream.html>

MappedByteBufferOutputStream
<http://jogamp.org/deployment/jogamp-next/javadoc/gluegen/javadoc/com/jogamp/common/nio/MappedByteBufferOutputStream.html>

~Sven



signature.asc (828 bytes) Download Attachment