"os" - make this a real namespace?
David Holmes
david.holmes at oracle.com
Thu Oct 20 11:37:03 UTC 2016
On 20/10/2016 6:27 PM, Rickard Bäckman wrote:
> Hi Thomas,
>
> I tried something like that a couple of years ago and still think it is
> a good idea.
>
> Link to the discussion and patches:
>
> http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-March/008884.html
Yeah but noone else seemed to like your os::pd approach :)
Cheers,
David
> /R
>
> On 10/19, Thomas Stüfe wrote:
>> Hi all,
>>
>> a small question.
>>
>> I sometimes stumble over the fact that "os" is a class, not a namespace.
>> And that we include the platform dependent additions into the middle of
>> this class.
>>
>> This has a number of repercussions, like not being able to include the
>> platform dependent files (os_<os>_<cpu>) directly, not being able to
>> forward declare functions from the "os" namespace (e.g. os::malloc) etc. I
>> also cannot split implementations from "os" functions to different
>> implementation files without problems.
>>
>> It seems to me all compiler nowadays support namespaces, would it not make
>> sense to convert "os" to a real namespace?
>>
>> While we are at it, what is the reason for the "<os>" sub classes? e.g.
>> os::Bsd, os::Aix etc? It makes integrating patches between platforms
>> difficult and, to me, does not seem to serve any clear purpose.
>>
>> If the purpose is to be a very low wrapper around OS particularities, it
>> makes no sense to have them in the "os" namespace and to make them visible
>> to the shared sections of the VM. E.g. there should be no reason to access
>> "os::Bsd" functions from outside os/bsd/vm, or to access "os::Posix"
>> functions outside implementations specific for Posix platforms.
>>
>> Thanks, and Kind Regards, Thomas
More information about the hotspot-runtime-dev
mailing list