RFR: 8291945: Add OSInfo API for static OS information [v2]
Thomas Stuefe
stuefe at openjdk.org
Thu Aug 11 05:26:04 UTC 2022
On Mon, 8 Aug 2022 21:50:17 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> As suggested by @tstuefe in the review of #9600, many of the `os` APIs simply return a value that was initialized during VM start up. E.g., `os::vm_page_size()`. I have added a new class `OSInfo` for managing such info
>>
>> - Simplifies the per-OS implementation
>> - Make the "init-only-once" check consistent
>> - In some cases, the simpler `OSInfo` class can be used in lieu of the more complex `os` class. This improves HotSpot build time (e.g., relocInfo.hpp).
>>
>> Note: I moved only 2 fields in this PR as a first step. If this works well I plan to move more fields in the future.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> fixed typo
Looks good!
Cheers, Thomas
src/hotspot/share/runtime/osInfo.hpp line 41:
> 39: static int vm_page_size() { return _vm_page_size; }
> 40:
> 41: // Returns the size in bytes of memory blocks which can be allocated.
Too vague and a bit misleading. Proposal:
`Returns size, in bytes, of the granularity with which memory can be reserved using os::reserve_memory().`
-------------
Marked as reviewed by stuefe (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9758
More information about the hotspot-dev
mailing list