On the D Blog--Symphony of Destruction: Structs, Classes, and the GC
Mike Parker
aldacron at gmail.com
Thu Mar 18 12:55:17 UTC 2021
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.
As I understand, finalizers in D are run because the GC needs
more memory *now*. Deferring release of memory until the next
collection would defeat the purpose. We would need to decouple
collection cycles from allocation. Am I missing something?
More information about the Digitalmars-d-announce
mailing list