From: Panayotis K. <pan...@pa...> - 2011-01-21 20:25:52
|
On Jan 21, 2011, at 9:46 PM, Arno Puder wrote: > > You are right: so-called convenience methods in Cocoa place the > newly-created object automatically in the autorelease pool. You can see > above that we create a temporary autorelease pool that we release again > immediately. When the GC reclaims the C version of UIButton, it will > call a finalizer (the __DELETE_* functions) that will do a 'release' in > the wrapped Objective-C UIButton. Isn't expensive to have an autorelease pool for every possible convenience selector of ObjC? (not only constructors...) Apart from that, since there *are* times that GC won't collaborate perfectly with autoreleased objects (like the situation I mentioned before with delayed animations ), is there a "backup plan" in the C backend to handle and fine tune the current memory management? (i.e. by using something like retain/release) ? |