Skip to content

Handle arrays in structures with differing size#1438

Merged
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:structure_differing_array_size
May 16, 2022
Merged

Handle arrays in structures with differing size#1438
matthiasblaesing merged 1 commit intojava-native-access:masterfrom
matthiasblaesing:structure_differing_array_size

Conversation

@matthiasblaesing
Copy link
Copy Markdown
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 matthiasblaesing force-pushed the structure_differing_array_size branch from a62ce02 to ed019cc Compare May 11, 2022 19:36
@matthiasblaesing
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants