RFR: 8265473: Move os::Linux to its own header file [v4]

David Holmes dholmes at openjdk.org
Mon Jul 11 00:59:32 UTC 2022


On Sat, 9 Jul 2022 23:27:31 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Another step of moving unnecessary stuff outside of os.hpp
>> 
>> The `os::Linux` class is used only by the Linux-specific code in HotSpot. Therefore, it should be moved outside of os.hpp, which is used by platform-independent code.
>> 
>> I don't have a good name for the new header. `os_linux.hpp` would have been a good name, but that's already taken, so I am settling on os_linux.impl.hpp. Suggestions are welcome.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   renamed to os_linux_impl.hpp

I share Thomas's surprise that this works. It also doesn't really make sense to me. You've rendered os_linux.hpp essentially an empty file and lament that there is not a good name for the new file because os_linux.hpp is taken - but that's because os_linux.hpp is actually where os::linux should be declared! 

You want to make os.hpp smaller so perhaps the thing to tackle is why os_<os>.hpp gets included in os.hpp in the first place. Unless it adds to the shared os API (which seems it can't as then it could just be in os.hpp) then there should not be anything in os_<os>.hpp that is needed for the shared os interface. So perhaps a different refactoring across all the os files is what is needed here.

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

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


More information about the hotspot-dev mailing list