structs, ~this(), this(this) and reference counting

Sönke Ludwig ludwig at
Sat Feb 18 02:32:07 PST 2012

After implementing automatic reference counting for resource management 
and spending the last two days with trying to figure out where the 
crashes and leaks come from and write workarounds for the corresponding 
compiler bugs, I came to the conclusion that this approach is futile. 
The code base is too large, as is the number of patterns that lead to 
compiler bugs.

Since the number of issues unusually high, instead of posting one bug 
report for each (posted two), I compiled a small test suite with a 
number of bug patterns that I discovered (and some working patterns). 
The list is probably not complete and I know that some cases that are OK 
in the test suite now failed for me in real code.

Anyway, do you think it makes sense to post this test suite as a meta 
bug for reference counting (excluding phobos RefCounted), so that 
somebody can look into it as a whole?

I get the feeling that otherwise it might take a very long time until 
everything is stable in this area - and IMO this is an extremely 
important area for anyone who needs to (partially or fully) avoid the 
GC. And, last but not least, just like linker crashes and ICEs, it may 
cause a very fragile impression for anyone who encounters this.

Test suite:
(Run with "dmd -g -run" or "dmd -g -version=BAILOUT -run")

More information about the Digitalmars-d mailing list