Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the life-cycle management of byte_buffer()'s result (a Java DirectByteBuffer instance) safe and transparent. #126

Open
jmao-denver opened this issue Jan 3, 2024 · 0 comments

Comments

@jmao-denver
Copy link
Contributor

jmao-denver commented Jan 3, 2024

A follow-up of #111

{"byte_buffer", JPy_byte_buffer, METH_VARARGS,
            "byte_buffer(obj) - Return a new Java direct ByteBuffer sharing the same underlying, contiguous buffer of obj via its implemented Buffer Protocol. The resulting PYObject must live "
            "longer than the Java object to ensure the underlying data remains valid. In most cases, this means that java functions called in this manner must not keep any references"
            " to the ByteBuffer"},

Right now the onus is on the user to heed and respect the warning. There might be a chance in the future to remove that if Java opens the DirectByteBuffer API up some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant