• 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: Unclear on -initWithBytesNoCopy:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unclear on -initWithBytesNoCopy:


  • Subject: Re: Unclear on -initWithBytesNoCopy:
  • From: Eli Bach2 <email@hidden>
  • Date: Sat, 03 Mar 2012 14:03:38 -0700

On Mar 3, 2012, at 12:15 PM, Jens Alfke wrote:

> I filed a bug report* saying that this substring optimization shouldn’t be used if the source string uses an external buffer, just as it shouldn’t if the source string is mutable. They fixed it, but some people there argue that their original implementation was correct (even if not compatible with Apple’s.) I’m curious, so I’m asking here to see if anyone knows for sure what’s intended.

Well, you can argue that the substring can't just reference the original string and bump it's retaincount to make sure the underlying data stays around because the original string doesn't own the data buffer.  For it to be 'correct', there would at least need to be some mechanism to notify the data buffer owner that another object was using it.

Eli


_______________________________________________

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


  • Follow-Ups:
    • Re: Unclear on -initWithBytesNoCopy:
      • From: Wade Tregaskis <email@hidden>
References: 
 >Unclear on -initWithBytesNoCopy: (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Question on handling very large images
  • Next by Date: Re: Image Colours
  • Previous by thread: Re: Unclear on -initWithBytesNoCopy:
  • Next by thread: Re: Unclear on -initWithBytesNoCopy:
  • Index(es):
    • Date
    • Thread