On the D Blog--Symphony of Destruction: Structs, Classes, and the GC
apz28
home at home.com
Fri Mar 19 14:29:59 UTC 2021
On Thursday, 18 March 2021 at 12:55:17 UTC, Mike Parker wrote:
> On Thursday, 18 March 2021 at 12:27:56 UTC, Petar Kirov
> [ZombineDev] wrote:
>
>>
>> Just implementation deficiency. I think it is fixable with
>> some refactoring of the GC pipeline. One approach would be,
>> (similar to other language implementations - see below), that
>> GC-allocated objects with destructors should be placed on a
>> queue and their destructors be called when the GC has finished
>> the collection. Afterwards, the GC can release their memory
>> during the next collection.
This need to improve which allow to call free memory in destructor
For realloc..., when size = 0, it needs to call free....
https://github.com/dlang/druntime/blob/3a32cc0305d4dd066f719d4c2df97337c86ea7ff/src/core/internal/gc/impl/conservative/gc.d#L444
vs
https://github.com/dlang/druntime/blob/3a32cc0305d4dd066f719d4c2df97337c86ea7ff/src/core/internal/gc/impl/conservative/gc.d#L678
More information about the Digitalmars-d-announce
mailing list