Re: Does the GC prioritize same-class when looking for things to free?

2022-09-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/15/22 1:12 PM, cc wrote: Why is Foo never deallocated here? (`DMD32 D Compiler v2.099.0-dirty` win64) In answer to your title question, no. It does not prioritize anything. If it thinks something is ready to be freed, it is freed. If it thinks something is not ready to be freed, it is

Does the GC prioritize same-class when looking for things to free?

2022-09-15 Thread cc via Digitalmars-d-learn
Why is Foo never deallocated here? (`DMD32 D Compiler v2.099.0-dirty` win64) ```d class Foo { string s; static size_t count, alloced, dealloced; this() { "+Foo".writeln; count++; alloced++; } ~this() {