• 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: Memory allocation issues with NSObject and NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory allocation issues with NSObject and NSString


  • Subject: Re: Memory allocation issues with NSObject and NSString
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 18 Jan 2009 20:59:22 -0800

On Jan 18, 2009, at 8:52 PM, Chris Suter wrote:
Are you sure about that? My understanding is that the second case ends
up pointing to a constant string and that retain and release are also
no-ops in that case.

Yah... but that is even more of an implementation detail than the first and *not* -release'ing something that you +alloc/-init'd would be asking for trouble.


Pick a pattern.  Stick with it.  Everywhere.  Always.

Until there is a damned good reason not to.

Also, if I remember rightly, that in the first case you'll end up
pointing to a constant in the current translation unit, whereas in the
second case you end up pointing to a global constant defined in
CoreFoundation. Implementation details, I know.

Way too much of an implementation detail for me. I have code to write!

Seriously -- I don't know off hand. I could go read the source and figure it out, but my general conclusion is that if I have to answer that particular question, I'm doing something terribly wrong.

b.bum
_______________________________________________

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


References: 
 >Memory allocation issues with NSObject and NSString (From: "Devraj Mukherjee" <email@hidden>)
 >Re: Memory allocation issues with NSObject and NSString (From: Bill Bumgarner <email@hidden>)
 >Re: Memory allocation issues with NSObject and NSString (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: ObjC in time-critical parts of the code
  • Next by Date: Re: Memory allocation issues with NSObject and NSString
  • Previous by thread: Re: Memory allocation issues with NSObject and NSString
  • Next by thread: Re: Memory allocation issues with NSObject and NSString
  • Index(es):
    • Date
    • Thread