Classes on stack

Redwan rdwnsjjd at gmail.com
Thu Sep 1 11:20:10 UTC 2022


On Thursday, 1 September 2022 at 10:21:32 UTC, rikki cattermole 
wrote:
>
> On 01/09/2022 10:13 PM, Redwan wrote:
>> if it's for GC, how to completely disable gc? I don't Wan use 
>> it at all. I searched for a compiler command line disabling 
>> for gc but not found. GC.disable() is ugly way I think.
>
> As long as you want to use things like classes and Phobos, 
> you're stuck with the GC being linked in and active at some 
> point in the lifetime of your process.
>
> D's runtime includes a lot of infrastructure such as threading 
> that is initialized before your main ever executes.
>
> You can limit the GC activity by things like GC.disable, but 
> its still linked in and in use at some point in time.
>
> D's GC is your friend, if you don't allocate it won't attempt 
> to collect unless you want it to.

the worst things about it is as I didn't start writing my code it 
already has memory leak :/


More information about the Digitalmars-d mailing list