Feedback from the Gripes and Wishes Campaign

Steven Schveighoffer schveiguy at gmail.com
Sun May 28 15:40:53 UTC 2023


On 5/28/23 3:02 AM, Walter Bright wrote:
> On 5/27/2023 6:40 PM, Steven Schveighoffer wrote:
>> On 5/27/23 5:21 PM, Walter Bright wrote:
>>> On 5/27/2023 11:26 AM, Steven Schveighoffer wrote:
>>>> It's CTFE, nobody cares about memory leaks
>>>
>>> They do when it starts running very slow and/or runs out of memory
>>
>> But that's no different from today.
> 
> Yes, and people care about it.

So using the GC isn't good enough then?

>>>> We don't run the GC at CTFE either.
>>>
>>> Yes, we do.
>>
>> We do?
> 
> 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.

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.

> 
>> In any case, migrating `malloc` calls to `new` and ignoring `free` 
>> should still be fine in this case.
> 
> That's how dmd used to operate, but people ran out of memory.
> 

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

-Steve


More information about the Digitalmars-d mailing list