Fix variable-size type mappings in mac SystemB and XAttr#1724
Merged
dbwiddis merged 1 commit intoMay 12, 2026
Conversation
8c45049 to
4ab4109
Compare
4ab4109 to
4450bf9
Compare
host_page_size used LongByReference for vm_size_t* which is pointer-sized. Add correct NativeLongByReference overload and deprecate the old one. XAttr getxattr/setxattr/listxattr used long for size_t/ssize_t parameters and return values. Add correct NativeLong overloads and deprecate the old ones. Update XAttrUtil to use the new methods.
4450bf9 to
95d793e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix incorrect use of
long/LongByReferencefor pointer-sized native types in macOS bindings.SystemB.host_page_size: The
vm_size_t *parameter was mapped asLongByReference(always 64-bit). Added correctNativeLongByReferenceoverload; deprecated the old signature.XAttr.getxattr/setxattr/listxattr: The
size_tparameters andssize_treturn values were mapped aslong(always 64-bit). Added correctNativeLongoverloads; deprecated the old signatures. UpdatedXAttrUtilto use the new methods.These types are pointer-sized (
unsigned longin C) and should be 4 bytes on 32-bit and 8 bytes on 64-bit. While macOS is effectively 64-bit-only today, JNA still supports 32-bit macOS and the mappings should be correct.