RFR: 8313302: Fix formatting errors on Windows [v3]
Stefan Karlsson
stefank at openjdk.org
Tue Aug 1 06:57:52 UTC 2023
On Fri, 28 Jul 2023 09:16:32 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
>>
>> zPhysicalMemoryBacking_windows.cpp
>
> src/hotspot/os/windows/gc/x/xMapper_windows.cpp line 253:
>
>> 251:
>> 252: if (!res) {
>> 253: fatal("Failed to unreserve memory: " INTPTR_FORMAT " " SIZE_FORMAT "M (%ld)",
>
> Here, and in many other places:
>
> PTR_FORMAT -> INTPTR_FORMAT both macros are the same.
>
> We use PTR_FORMAT in many many places to print pointers. I prefer it to INTPTR_FORMAT, since it does not convey the assumption of a type. After all, the type does not matter: we just print the pointer as a raw hex value. Also, INTPTR suggests intptr_t which suggests signedness, which has no place here.
>
> *If* we want to change this, we should first agree on the INTPTR_FORMAT vs PTR_FORMAT difference. And why we use intptr_t in many places that actually call for an uintptr_t.
>
> But I would not change it. There is no need.
Yes. Please keep using PTR_FORMAT to print what's semantically a pointer in ZGC.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15063#discussion_r1280183227
More information about the graal-dev
mailing list