Theocacao
Leopard
Design Element
Comment on "Objective-C Garbage Collection: Take 2"
by Scott Stevenson — May 22
because you just have to move the top of heap pointer 10,000 times. Malloc has to allocate 10,000 separate blocks instead

It's actually more complicated than that because all the object ivars have to be malloc'd as well.

On the other hand, you can sometimes avoid a lot of this overhead by doing a malloc of a large block of memory (sizeof(id) * 10000), and stuffing in the isa pointers in the appropriate places.

But yes, I understand the basic point you're making.
Back to "Objective-C Garbage Collection: Take 2"
Design Element

Copyright © Scott Stevenson 2004-2015