Re: Garbage Collection Docs Puzzle
Re: Garbage Collection Docs Puzzle
- Subject: Re: Garbage Collection Docs Puzzle
- From: Robert Clair <email@hidden>
- Date: Mon, 25 Jan 2010 18:41:49 -0500
> The issue being worked-around is that of the compiler; during
> optimization, if you stop referencing myData,
[snip]
Yes. As I said, I understand the issue - my only question was whether the short-circuited retain was enough to do it. I didn't know whether the compiler did this or the runtime. Thanks for enlightening me.
> perhaps an appropriately-named macro would be more fitting.
Something on the order of
_KEEP_ALIVE_( myData )
would be much more fitting and far less confusing to someone reading your code or a beginner reading the docs.
> Except -retain is more efficient under GC.
Probably irrelevant. Any realistic thing you would be doing with any realistic number of bytes in the NSData object would swamp the difference between a short circuited retain dispatch and a dispatch of -self.
...Bob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden