RFR: 8286876: NMT.test_unaliged_block_address_vm_assert fails if using clang toolchain [v6]

Johan Sjölen jsjolen at openjdk.org
Mon Jan 16 18:36:15 UTC 2023


On Mon, 16 Jan 2023 16:32:53 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Style
>>  - Style
>
> src/hotspot/share/services/mallocHeader.hpp line 154:
> 
>> 152:   // hex dump surrounding the broken block), then trigger a fatal error
>> 153:   inline static const MallocHeader* resolve_checked(const void* memblock);
>> 154:   inline static MallocHeader* resolve_checked(void* memblock);
> 
> Is there's a particular reason why in&out types need to match in terms of `const`? Does this work?
> 
> 
>   inline static MallocHeader* resolve_checked(const void* memblock);

Good question. Perhaps in this specific case we can throw away the const information, but it's difficult to discover whether that's true and doesn't look correct to a reader at a first glance. I think an extra method reduces reading complexity such that it is worth keeping.

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

PR: https://git.openjdk.org/jdk/pull/11465


More information about the hotspot-runtime-dev mailing list