• 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: Is @"constantstring" pointer equal to @"constantstring" aguarantee?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee?


  • Subject: Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee?
  • From: Ken Ferry <email@hidden>
  • Date: Fri, 28 Mar 2008 04:02:56 -0700

On Mar 28, 2008, at 2:36 AM, Chris Hanson <email@hidden> wrote:

Yup. And they're not allocated on the heap; they're stored in the executable It's slightly more complicated than that -- there's also GCC's "-fno-constant-cfstrings" option, which will cause at least CFSTR() constants (I'm not sure whether it also covers @"" constants) to be created dynamically rather than statically.


The flag does not cover @"" strings, but there's a bug that it should.

-Ken



This is important for developers of bundles which may be unloaded, because a pointer to a constant string in an executable that's will become a dangling pointer if that executable is unloaded.

 -- Chris

_______________________________________________

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
_______________________________________________

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: 
 >Re: Is @"constantstring" pointer equal to @"constantstring" a guarantee? (From: "Kyle Sluder" <email@hidden>)
 >Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee? (From: "Kyle Sluder" <email@hidden>)
 >Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee? (From: Jens Alfke <email@hidden>)
 >Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee? (From: Chris Hanson <email@hidden>)

  • Prev by Date: QTMovie delegate method with 64 bit
  • Next by Date: Bitmaps and color shift
  • Previous by thread: Re: Is @"constantstring" pointer equal to @"constantstring" aguarantee?
  • Next by thread: Core Data faulting and bindings: recursive KVO notifications?
  • Index(es):
    • Date
    • Thread