D with minimal runtime

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 17 12:48:03 UTC 2020


On 6/17/20 5:06 AM, Jacob Carlborg wrote:
> On 2020-06-17 06:08, H. S. Teoh wrote:
> 
>> As of recent releases, GC initialization is actually lazy now, it will
>> not initialize anything until you actually use it.  Still one step away
>> from being totally optional, granted, but it shouldn't be *too*
>> difficult to make it so that, e.g., the GC code isn't even linked unless
>> there's a reference to one of its symbols somewhere.
> 
> How would the GC know if it needs to initialize itself if you allocate 
> the object at compile time, i.e.:
> 
> __gshared a = new Object; // module scope

Wouldn't that be allocated during compilation, and frozen at runtime 
(i.e. essentially static data)? That's my recollection of what happens.

> Or is it expected that the above object fill never be freed?

I don't think it's ever allocated actually.


More information about the Digitalmars-d mailing list