Hacker News new | past | comments | ask | show | jobs | submit login

Sorry, but I just wonder wouldn't this pointer to self structure prevent garbage collection?



Reference cycles aren't a problem for GCs because any objects that aren't reachable from a root set of nodes are considered garbage and get collected. (I only read part of the article, but hopefully that answers your question...)


To clarify, they aren't a problem for mark/sweep GCs. Reference counting can be considered a form of GC.


Cool, thanks :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: