• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Garbage Collection Docs Puzzle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: another responder chain docs bug (validateUserInterfaceItem:)
  • Next by Date: Re: Fastest way to convert an NSDate into an NSString
  • Previous by thread: Re: Garbage Collection Docs Puzzle
  • Next by thread: How to detect no internet connection?
  • Index(es):
    • Date
    • Thread