• 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: Where's the buffer overrun?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where's the buffer overrun?


  • Subject: Re: Where's the buffer overrun?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 19 Mar 2008 21:56:31 -0700


On 19 Mar '08, at 5:49 PM, Hamish Allan wrote:

I, for one, am surprised that NSMutableData works this way, given that
a) the method name specifically requests that no copy is made, and b)
there's no particular reason for it to behave that way unless the data
is resized.

The ...noCopy family of methods are really just suggestions. They don't guarantee that the Foundation object will use that block of memory for its internal storage, only that it'll take ownership of the block and free it when it's done with it. It's never a good idea to make assumptions about where a Foundation object is putting its data; if you need to access the current bytes of an NSData, call -bytes on it.


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Where's the buffer overrun?
      • From: "Hamish Allan" <email@hidden>
    • Re: Where's the buffer overrun?
      • From: "Michael Ash" <email@hidden>
References: 
 >Where's the buffer overrun? (From: Nick Zitzmann <email@hidden>)
 >Re: Where's the buffer overrun? (From: Chris Suter <email@hidden>)
 >Re: Where's the buffer overrun? (From: Andrew Farmer <email@hidden>)
 >Re: Where's the buffer overrun? (From: Chris Suter <email@hidden>)
 >Re: Where's the buffer overrun? (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: Re: How to remove a fetched predicate from an ArrayController?
  • Next by Date: Seeking a proficient Cocoa developer for a short-term contract in Cambridge, MA
  • Previous by thread: Re: Where's the buffer overrun?
  • Next by thread: Re: Where's the buffer overrun?
  • Index(es):
    • Date
    • Thread