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

Handle arrays in structures with differing size #1438

Conversation

matthiasblaesing
Copy link
Member

@matthiasblaesing matthiasblaesing commented May 10, 2022

libffi uses ffi_type structures to describe arrays and structures passed
to native. JNA builds these structures and caches them using the
associated classes as keys. For arrays this leads to the situation where
only a single ffi_type was stored for all sizes of the same base type.
This in turn causes wrong behavior in libffi.

libffi uses ffi_type structures to describe arrays and structures passed
to native. JNA builds these structures and caches them using the
associated classes as keys. For arrays this leads to the situation where
only a single ffi_type was stored for all sizes of the same base type.
This in turn causes wrong behavior in libffi.
@matthiasblaesing
Copy link
Member Author

@matthiasblaesing matthiasblaesing changed the title Draft: Handle arrays in structures with differing size Handle arrays in structures with differing size May 12, 2022
Copy link
Contributor

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not having deep knowledge of the original issue I am hesitant to check 'approve' but I have reviewed the code and it all looks sane.

@matthiasblaesing
Copy link
Member Author

@dbwiddis thanks for having a look

@matthiasblaesing matthiasblaesing merged commit 63ba30f into java-native-access:master May 16, 2022
@matthiasblaesing matthiasblaesing deleted the structure_differing_array_size branch May 16, 2022 18:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants