RFR: 8364128: Improve gathering of cpu feature names using FormatBuffer
Johan Sjölen
jsjolen at openjdk.org
Tue Jul 29 07:21:56 UTC 2025
On Tue, 29 Jul 2025 06:54:32 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> This PR implements the code for cpu features names string using FormatBuffer. It also improves and extends FormatBuffer with an additional method that appends comma separated strings to the buffer. This is useful in creating the cpu features names string.
>> This code will also be useful in Leyden to implement cpu feature check for AOTCodeCache [0].
>> Platforms affected: x86-64 and aarch64
>> Other platforms can be done if and when Leyden changes are ported to them.
>>
>> [0] https://github.com/openjdk/leyden/pull/84
>
> src/hotspot/cpu/x86/vm_version_x86.cpp line 1113:
>
>> 1111: insert_features_names(_features, info_buffer);
>> 1112:
>> 1113: _cpu_info_string = os::strdup(info_buffer);
>
> Sorry, I'm going to need some help here :-). How can passing a `FormatBuffer` to `os::strdup` not fail to compile?
And here we do `os::strdup`, so now we do have dynamic allocation, so maybe just use a `stringStream`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26515#discussion_r2238737303
More information about the hotspot-dev
mailing list