Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

GetPrimitiveArrayCritical should not be used #19

Open
bgilbert opened this Issue May 15, 2014 · 1 comment

Comments

Projects
None yet
2 participants
Owner

bgilbert commented May 15, 2014

The JNI code uses GetPrimitiveArrayCritical() to get destination buffers for read_region() and read_associated_image(). This was presumably done to avoid an extra buffer copy, but the JNI documentation cautions that the *Critical methods should not be used for long-running operations.

bgilbert added the defect label May 15, 2014

Owner

agoode commented May 15, 2014

In theory this should be fine. I don't see any rules we are breaking here with the critical methods. As far as I can see, the alternative is to use the NIO GetDirectBufferAddress which you could probably retrofit into things.

bgilbert added this to the v1.0 milestone Jan 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment