The "no gc" crowd

Michel Fortin michel.fortin at michelf.ca
Wed Oct 9 06:06:22 PDT 2013


On 2013-10-09 07:33:29 +0000, Manu <turkeyman at gmail.com> said:

> Is there more to it? Cleaning up circular references I guess... what does
> Apple do?

Apple implemented auto-nulling weak pointers for ARC (as well as 
__unsafe_unretained ones if you are not afraid of dangling pointers).

> It's an uncommon edge case, so there's gotta be heaps of room for efficient
> solutions to that (afaik) one edge case. Are there others?

I don't know about you, but circular references are not rare at all in my code.

Another solution that could be used for circular references is to have 
the stop-the-world GC we have now collect them. Reference counting 
could be used to free GC memory in advance (in the absence of circular 
references), so the GC would have less garbage to collect when it runs.

Both solutions (week-autonulling and last-resort GC) are not mutually 
exclusive and can coexist.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list