On Mon, 5 Jan 2026 12:31:10 GMT, Maurizio Cimadamore <[email protected]> 
wrote:

>> 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`

Ah yes, thanks for pointing out. I forgot to update it when changing "long" to 
"size_t".

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

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

Reply via email to