RFR: 8290840: Refactor the "os" class [v3]

Ioi Lam iklam at openjdk.org
Tue Aug 2 06:56:38 UTC 2022


On Mon, 1 Aug 2022 19:22:28 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Very good work. Only small remarks/nitpickings.
> 
> One question though, how does it work if I want to use an API implemented on a per-platform base in shared code? E.g. `zero_page_read_protected()`? I include `os.hpp` to get the definition, but how do I get the implementation? I have to include the platform-specific inline header too? Still with the OS_HEADER macro?
> 
> Cheers, Thomas

I think we should avoid creating non-portable os::xxx APIs and then call them from shared code. There were some calls to os::Posix::xxx from the shared code that I fixed in this PR.

If you really want to make a platform-specific call, you should just do this (sadly we have many such cases)


#ifdef LINUX
linux_blah();
#endif


Putting linux_blah() into the os class seems pointless.

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

PR: https://git.openjdk.org/jdk/pull/9600


More information about the hotspot-dev mailing list