On Fri, 2 Jan 2026 17:00:37 GMT, Weijun Wang <[email protected]> wrote:

>> Rewrite the native calls with FFM.
>
> Weijun Wang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   fail early on Windows, and more comments

src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java
 line 87:

> 85:             = ((AddressLayout) LINKER.canonicalLayouts().get("void*"))
> 86:             
> .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, 
> C_CHAR));
> 87:     private static final ValueLayout.OfLong C_SIZE_T

Note that portability between 32/64 is hard, even if using canonicalLayouts -- 
because size_t will likely be an IntLayout on arm32, while a LongLayout in 64 
bits. If you never use this layout to access data (e.g. call 
`MemorySegment::get/set`) I'd suggest to avoid the cast, and leave it just as 
`ValueLayout`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28931#discussion_r2661342378

Reply via email to