RFR: 8265066: Split ReservedSpace constructor to avoid default parameter [v2]

Stefan Johansson sjohanss at openjdk.java.net
Thu Apr 15 09:24:51 UTC 2021


On Thu, 15 Apr 2021 08:51:21 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Stefan Johansson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Thomas review.
>>   
>>   Removed assert.
>
> src/hotspot/share/memory/virtualspace.cpp line 58:
> 
>> 56: 
>> 57: ReservedSpace::ReservedSpace(size_t size, size_t preferred_page_size) : _fd_for_heap(-1) {
>> 58:   assert(is_power_of_2(preferred_page_size), "invariant");
> 
> Shouldn't this be something like `is_one_of_available_page_sizes` (or potentially 0 if this means "any")? This assert hasn't been in the original code, and it does not seem correct, so maybe it's not worth putting here too?

Yes, you are correct. The assert would only catch bogus values, and having the assert query the os-layer here might be a bit over the top. I'll just remove the assert for now.

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

PR: https://git.openjdk.java.net/jdk/pull/3457


More information about the hotspot-dev mailing list