Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Object cycles, when two or more objects refer to each other, are currently not handled by the runtime, but will be in future releases."

So, basically, you're stuck with retain cycles right now. My bet is that they implement a way of marking weak references rather than becoming more intelligent than ARC.



I wonder how big a deal this will be. Relying on GC feels like it goes hand in hand with dynamic languages. I'm used to not having to worry about cycles.

Of course, I guess I'm use to not having to worry too much about memory, either ...

Weak references aren't a panacea. It's not that uncommon to have cycles where all edges are equally strong. Any social graph ...

I use use counts to collect those cycles. ARC doesn't let you use use counts, but you don't have to use ARC everywhere. You do have to access to the underlying use counts ... MacRuby should allow access to that (it's just a standard Cocoa call) as long as it doesn't keep stray retains around that screw up my count balances ...


You can still use counts — you just can't use Foundation's retain count.

And I think CoreData is the answer to problems like a social graph. It does its own specialized memory management. But you're right, it's awkward to have to think about it.




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

Search: