Re: Buffer protocol - direct vs. JVM ByteBuffers
"Stefan Richthofer" <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <trinity-39e5570e-172f-4ff1-bb18-7ebeb9125b63-1463326773767@3capp-gmx-bs40> |
Just an add-on to my recent post: >It may depend on storage.hasArray(), but storage.isDirect() seems to make no difference. I think it is likely the JVM does not offer a backing array, if the buffer is created as direct (i.e. these flags likely exclude each other), because this would imply array pinning and all the restrictions coming with it. I didn't test it though, but anyway we cannot rely on the one or other behavior, as doc explicitly does not guarantee a backing array for direct buffers, saying this is "implementation specific". Gesendet: Sonntag, 15. Mai 2016 um 11:57 Uhr Von: "Jeff Allen" <[email protected]> An: "Stefan Richthofer" <[email protected]>, "Jython Developers" <[email protected]> Betreff: [Jython-dev] Buffer protocol - direct vs. JVM ByteBuffers Stefan: https://github.com/jythontools/jython/pull/39 What difference does it make in your use case whether a NIO ByteBuffer is direct or non-direct? I can see why a client might want to know which it had been given, but not why it might want an exception raised in one or other case. Nothing I'm doing seems to depend on what kind of memory the exporting object has, therefore on the implementation type of ByteBuffer storage. It may depend on storage.hasArray(), but storage.isDirect() seems to make no difference. Jeff -- Jeff Allen ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j_______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jytho n-dev ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Jython-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jython-dev