RFR: 8324686: Remove redefinition of NULL for MSVC

Aleksey Shipilev shade at openjdk.org
Wed Apr 9 07:55:38 UTC 2025


On Wed, 9 Apr 2025 06:16:18 GMT, Kim Barrett <kbarrett 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.

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24537#pullrequestreview-2752459435


More information about the hotspot-dev mailing list