On Fri, 17 Apr 2026 08:13:43 GMT, Stefan Karlsson <[email protected]> wrote:
>> In JDK-8381934 "Wrong type passed to FREE_C_HEAP_ARRAY deallocating >> G1CardSetMemoryManager" we saw how the wrong type was being passed to the >> FREE_C_HEAP_ARRAY macro. That bug is benign, because the type parameter is >> not used. I see that we have similar issues in some of our gtests. I propose >> that we get rid of the type parameter to remove this confusion and lower the >> line noise on these lines. >> >> I also propose that we get rid of it from the REALLOC_ macros. These macros >> however are using the type parameter, but we can infer the type from the >> other parameters, so I propose that we do that instead. >> >> Tested with tier1-3 >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Stefan Karlsson has updated the pull request incrementally with two > additional commits since the last revision: > > - Use REALLOC_RETURN_TYPE in arena.hpp > - Minor tweak of comment src/hotspot/share/interpreter/oopMapCache.cpp line 157: > 155: if (has_valid_mask() && mask_size() > small_mask_limit) { > 156: assert(_bit_mask[0] != 0, "should have pointer to C heap"); > 157: FREE_C_HEAP_ARRAY((uintptr_t*)_bit_mask[0]); ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30786#discussion_r3099235919
