RFR: JDK-8257588: Make os::_page_sizes a bitmask [v4]

Thomas Stuefe stuefe at openjdk.java.net
Fri Dec 4 16:51:20 UTC 2020


On Fri, 4 Dec 2020 16:47:30 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/share/runtime/os.cpp line 1894:
>> 
>>> 1892: size_t os::PageSizes::smallest() const {
>>> 1893:   assert(min_page_size() > 0, "Sanity");
>>> 1894:   return next_larger(min_page_size() / 2);
>> 
>> I'm not sure why you use min_page_size() / 2 instead of another small enough power_of_2, say the smallest one:
>> return next_larger(1);
>> and thereby get rid of the dependency on the odd min_page_size().
>
> True. Earlier implementation had a lop in next_larger. But now it does not matter. 1 is fine.

(Note that min_page_size should be really a constant, and named differently. I have this mentally marked as another small cleanup)

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

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


More information about the hotspot-dev mailing list