Keeping optimal autorelease pools

Martin Pilkington on autorelease pools:

However, a problem arises when you’re creating a lot of objects at once. The obvious solution is to initialise and release objects by hand in this case, but sometimes it isn’t possible. A lot of objects returned by Cocoa methods are autoreleased (by convention any object returned by a class method (other than +new or +alloc) should be autoreleased).

This is a good practical example of autorelease pool manipulation, including numbers showing before and after.

This entry was posted in Technology and tagged , , , , . Bookmark the permalink.

Comments are closed.