RFR: 8324686: Remove redefinition of NULL for MSVC

Kim Barrett kbarrett at openjdk.org
Thu Apr 10 10:24:36 UTC 2025


On Wed, 9 Apr 2025 07:52:44 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Please review this change that removes the redefinition of NULL in
>> globalDefinitions_visCPP.hpp. That redefinition was to support the use of NULL
>> in a varargs context, because of the size difference for int vs a pointer.
>> However, we no longer have any direct uses of NULL in HotSpot, and have a test
>> that ensures there is no backsliding.
>> 
>> There may be indirect uses of NULL via third-party libraries.  Such uses could
>> have been in the scope of the removed redefinition.  But those uses must have
>> been correct even without the redefinition, else they would be incorrect for
>> non-HotSpot users.
>> 
>> Testing: mach5 tier1-3, GHA sanity tests
>
> Looks fine. So, just to be extra clear, this would only affect Hotspot, not JDK. There are no interesting hits for `NULL`-s right now in Hotspot code. There are still lots of `NULL`-s in JDK native code.

Thanks for reviews @shipilev and @dholmes-ora .

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

PR Comment: https://git.openjdk.org/jdk/pull/24537#issuecomment-2792271505


More information about the hotspot-dev mailing list