RFR: 8330076: NMT: add/make a mandatory MEMFLAGS argument to family of os::reserve/commit/uncommit memory API [v7]

Thomas Stuefe stuefe at openjdk.org
Tue Apr 30 12:06:15 UTC 2024


On Tue, 30 Apr 2024 08:55:31 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/share/memory/virtualspace.cpp line 57:
>> 
>>> 55: }
>>> 56: 
>>> 57: ReservedSpace::ReservedSpace(size_t size, size_t preferred_page_size, MEMFLAGS flag) : _fd_for_heap(-1), _nmt_flag(flag) {
>> 
>> Small nit: Mixture of styles. As much as I dislike it, current style is to initialize things via dedicated initialize methods. I'd rather stay consistent.
>> 
>> That said, I would be more than happy for someone to give these classes a once-over and convert them to the more usual style - using initializer lists. Then, we also can make members const that should be const, e.g. _nmt_flags. Not in this PR though.
>
> Do you mean to move the initializations on line 57 (and others in the files) to the `initialize` method?

Or, just remove it. The initialise function already initialises the member, right?

But it's really a small nit. I like your variant more if it were uniquely applied.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18745#discussion_r1584684694


More information about the shenandoah-dev mailing list