RFR: 8253332: ZGC: Make heap views reservation platform independent [v3]

Stefan Karlsson stefank at openjdk.java.net
Mon Sep 21 06:21:38 UTC 2020


On Fri, 18 Sep 2020 15:14:25 GMT, Per Lidén <pliden at openjdk.org> wrote:

> > I choose to prefix the OS dependent functions with os_. For consistency, initialize_os should have been renamed as
> > well, but the plan is to change that in a separate patch that splits that function into two, so I skipped it for now.
> 
> May I suggest that we instead just keep to the convention we have (here and in other classes) and use an _os suffix on
> these new functions?

There's no strong convention that we postfix with os. During the Windows port I introduced two usages, both named
initialize_os. Now when more OS specific code is added, and I need to split initialize_os into two function, the
postfix makes it less clear what the OS-specific API extension points are.

Some of my motivations for going with a prefix instead:
1) HotSpot already does that in other places. See the pd_ functions. For example, pd_commit_memory vs commit_memory.

2) Splitting initialize_os wouldn't create an infix:
os_initialize_before_reserve
os_initialize_after_reserve
vs
initialize_os_before_reserve
initialize_os_after_reserve

3) Easily recognized group of os specific funtions
os_initialize_before_reserve
os_initialize_after_reserve
os_reserve
os_unreserve

4) reserve_os sounded worse than os_reserve (to me)

I was considering splitting it out into a sub-interface, just to not have to deal with the *fix discussion/problem, but
decided against it since the implementations needed member variables from ZVirtualMemoryManager.

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

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



More information about the hotspot-gc-dev mailing list