Design Element
Comment on "Objective-C Garbage Collection: Take 2"
by Pierce — May 20
Actually, GC can be faster then all that retain/release stuff.

For instance in Java, with EOF, you can fetch 10,000 objects into memory much more quickly, because you just have to move the top of heap pointer 10,000 times. Malloc has to allocate 10,000 separate blocks instead.

That said, the other reality is that GC is to some extent a trade off. Do you do a .1 millisecond call 10,000 times over the course of an hour, or freeze for 20 seconds to GC?

In java, what ends up happening sometimes is that you end up explicitly setting pointers to null after you're done with them, just so that the GC system knows you're done with the object asap. So you've traded retain/release/autorelease for "release".

Personally, I think the GC system will function great as a way to debug leaks...
Back to "Objective-C Garbage Collection: Take 2"
Design Element

Copyright © Scott Stevenson 2004-2015