Unused druntime code: Barrier, ReadWriteMutex, Condition
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Tue Jun 16 10:57:05 UTC 2026
On 16/06/2026 10:48 PM, Denis Feklushkin wrote:
> On Tuesday, 16 June 2026 at 10:38:27 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>
>>> I.e., core.stdc shouldn't be necessary.
>>>
>>> Let the druntime use these functions through wrapper functions. There
>>> will be only about 10 of them in total, I think: malloc/free, some
>>> sync methods...
>>>
>>> This will solve 95% of porting issues to any system
>>
>> Chuck it into a module called core.internal.platform and sure.
>>
>> You shouldn't need wrapper functions for the most part. Aliases will
>> suffice. I.e. malloc is perfectly fine as an API, just needs a
>> different name so it can be swapped out easily.
>
> Yes, maybe aliases. Point is in restrictions for druntime developers to
> avoid them to use core.stdc functions directly exept available ~10
> aliases, same on all platforms, same for Posix, non-Posix, with libc or
> without - this doesn't matter
Yeah its a known issue with druntime when it comes to porting it.
Its very all or nothing.
So it was an easy yes, and I doubt anyone will have an opinion against it.
More information about the Digitalmars-d
mailing list