Feedback from the Gripes and Wishes Campaign

Walter Bright newshound2 at digitalmars.com
Mon May 29 05:18:49 UTC 2023


On 5/28/2023 8:40 AM, Steven Schveighoffer wrote:
> So using the GC isn't good enough then?

It's good enough for CTFE :-)


>> Every time an allocation is made with the GC, the GC may run a collection cycle.
> During CTFE too? I mean CTFE allocates memory like crazy anyways (like for 
> adding two integers), but I thought collections did not run *during* CTFE.

The GC may run a collection cycle anytime a GC allocation is done.


> I obviously could be wrong, but I thought the interpreter's data was 
> self-contained, and when it was done, then it could become garbage.

I tried to do that at one point, and failed, after spending a couple weeks on 
it. It's not impossible, it's just that our CTFE implementation is a rat's nest 
and defies such improvements.

I did get a lot of the allocations done on the stack, which do go away when it 
returns. But not all.


> If malloc allocates GC memory, wouldn't the GC just take care of it?

Then you might as well just use the GC instead of malloc.



More information about the Digitalmars-d mailing list