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

Is there documentation about Pointer behavior liveliness? #299

Closed
nugend opened this issue Dec 21, 2013 · 1 comment
Closed

Is there documentation about Pointer behavior liveliness? #299

nugend opened this issue Dec 21, 2013 · 1 comment

Comments

@nugend
Copy link

nugend commented Dec 21, 2013

I was encountering an error where invoking p.getString(0) was returning a value of "I". Eventually I realized that the problem was that I was trying to access the Pointer outside of the function context that my pointer had been returned in. I can see why this would be a problem in retrospect, but I don't recall reading anything about Pointer liveliness when I read through the documentation.

Thanks.

@twall
Copy link
Contributor

twall commented Dec 21, 2013

Aside from primitive array parameters having a “liveliness” scope of the native function call, there’s nothing JNA-specific about that sort of data validity.

Some functions may return heap-allocated memory, some may return statically-allocated memory, some may even (dangerously) return stack-based memory.

The Pointer itself merely represents a native address, and makes no guarantees about its validity or lifecycle.

On Dec 20, 2013, at 7:25 PM, Daniel Nugent [email protected] wrote:

I was encountering an error where invoking p.getString(0) was returning a value of "I". Eventually I realized that the problem was that I was trying to access the Pointer outside of the function context that my pointer had been returned in. I can see why this would be a problem in retrospect, but I don't recall reading anything about Pointer liveliness when I read through the documentation.

Thanks.


Reply to this email directly or view it on GitHub.

@twall twall closed this as completed Jan 12, 2014
mstyura pushed a commit to mstyura/jna that referenced this issue Sep 9, 2024
Motivation:

We should update to the latest quiche sha to consume fixes

Modifications:

- Update to 7eb57c4fc608932acc76c3ee2759c2e41e51d566
- Adjust pom.xml to be able to build

Result:

Use latest quiche commit
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

2 participants