RFR: 8345120: A likely bug in StringSupport::chunkedStrlenShort [v3]
Per Minborg
pminborg at openjdk.org
Mon Dec 2 10:17:38 UTC 2024
On Fri, 29 Nov 2024 12:19:52 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix imports
>
> src/java.base/share/classes/jdk/internal/foreign/StringSupport.java line 128:
>
>> 126: */
>> 127: @ForceInline
>> 128: public static int strlenByte(final AbstractMemorySegmentImpl segment,
>
> Note: clients of this method seems to always pass `segment.byteSize()` for `toOffset`. What is the value of passing it as an explicit parameter instead of having `byteSize()` being called inside the method?
As this is an internal API, I tried to keep it as similar as possible to the other bulk operations. But as you say, the value used here for the last parameter is always `segment.byteSize()`. We could easily change it. What's your preference here?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22451#discussion_r1865582368
More information about the core-libs-dev
mailing list