RFR: 8361085: MemoryReserver log_on_large_pages_failure has incorrect format usage
David Holmes
dholmes at openjdk.org
Tue Jul 1 03:49:37 UTC 2025
On Mon, 30 Jun 2025 16:11:47 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this fix of an incorrect format usage.
>
> The function calls `jio_snprintf` to format a message into a buffer. That
> message includes printing a pointer using `PTR_FORMAT`, but isn't using the
> `p2i` helper function. Fixing that is just a matter of using that helper.
>
> However, there's no need to use `jio_snprintf` here, as the resulting message
> is then just passed to `warning`, which can handle output formatting directly.
> So we also move the formatting to the `warning` call, and remove the use of
> `jio_snprintf`. Note that calling `warning` without the `p2i` would have
> produced a compiler warning about the incorrect format usage.
>
> Testing: mach5 tier1
Looks good.
It is strange that this pattern of doing a warning used to be used in a few places, even though `warning` has always been able to handle the formatting directly.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26050#pullrequestreview-2973378738
More information about the hotspot-runtime-dev
mailing list