RFR: 8326716: JVMTI spec: clarify what nullptr means for C/C++ developers [v2]

Quan Anh Mai qamai at openjdk.org
Fri May 17 03:52:01 UTC 2024


On Fri, 17 May 2024 00:43:18 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> The following RFE was fixed recently:
>> [8324680](https://bugs.openjdk.org/browse/JDK-8324680): Replace NULL with nullptr in JVMTI generated code
>> 
>> It replaced all the `NULL`'s in the generated spec with`nullptr`. JVMTI agents can be developed in C or C++.
>> This update is to make it clear that `nullptr` is C programming language `null` pointer.
>> 
>> I think we do not need a CSR for this fix.
>> 
>> Testing: N/A (not needed)
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: corrected the nullptr clarification

src/hotspot/share/prims/jvmti.xml line 1007:

> 1005:     explicitly deallocate. This is indicated in the individual <jvmti/>
> 1006:     function descriptions.  Empty lists, arrays, sequences, etc are
> 1007:     returned as a null pointer (C <code>NULL</code> or C++ <code>nullptr</code>).

This may be a little unnecessary rigor, but I believe that `nullptr` is not a null pointer. `nullptr` is the pointer literal that can be implicitly converted to a null pointer value of any pointer type and any pointer to member type. And I think the thing returned here is a null pointer, not `nullptr`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19257#discussion_r1604313245


More information about the serviceability-dev mailing list