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

Stefan Karlsson stefank at openjdk.org
Thu Apr 18 09:41:04 UTC 2024


On Thu, 18 Apr 2024 08:39:25 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> src/hotspot/share/cds/filemap.cpp line 1697:
>> 
>>> 1695: static char* map_memory(int fd, const char* file_name, size_t file_offset,
>>> 1696:                         char *addr, size_t bytes, bool read_only,
>>> 1697:                         bool allow_exec, MEMFLAGS flags) {
>> 
>> It is odd that `map_memory` and `os::map_memory` has different parameter order. I understand that this is done because of default values, but I'd like to suggest that you get rid of these default values and fix the order.
>> 
>> (Side-note: Wouldn't it be better to rename this `map_memory` to something that clearly shows the difference between this function and `os::map_memory`)
>
> `map_memory` is renamed to `map_and_pretouch_memory`.
> argument orders match with `os::map_memory`.

Thanks. The parames need to be adjusted after the rename.

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

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


More information about the shenandoah-dev mailing list