A separate GC idea - multiple D GCs

Tejas notrealemail at gmail.com
Sat Jan 22 01:54:54 UTC 2022


On Friday, 21 January 2022 at 22:56:46 UTC, H. S. Teoh wrote:
> On Fri, Jan 21, 2022 at 02:43:31PM -0800, Walter Bright via 
> Digitalmars-d wrote:
>> [...]
>
> It almost makes one want to tag pointer types at compile-time 
> as thread-local or global. Casting from thread-local to global 
> would emit a call to some druntime hook to note the transfer 
> (which, presumably, should only occur rarely). Stuff with only 
> global references will be collected by the global GC, which can 
> be scheduled to run less frequently (or disabled if you never 
> do such casts).
>
> But yeah, this is a slippery slope on the slide down towards 
> Rust... :-P It seems we just can't get any farther from where 
> we are without starting to need managed pointer types.
>
>
> T

Isn't going global from thread local done via `cast(shared)` 
though? Is that not enough to notify the compiler?


More information about the Digitalmars-d mailing list