• 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: "Hamish Allan" <email@hidden>
  • Date: Thu, 20 Mar 2008 01:46:25 +0000

On Thu, Mar 20, 2008 at 1:42 AM, Chris Suter <email@hidden> wrote:

>  I suspect that it will just end up getting documented as behaving this
>  way and that's fair enough, I think—it is NSMutableData after all.

Turns out it's already documented
(http://developer.apple.com/documentation/Cocoa/Conceptual/BinaryData/Tasks/WorkingBinaryData.html):

"However, if you create an NSData object with one of the methods whose
name includes NoCopy (such as dataWithBytesNoCopy:length:), the bytes
are not copied. Instead, the data object takes ownership of the bytes
passed in as an argument and frees them when the object is released.
(NSMutableData responds to these methods, too, but the bytes are
copied anyway and the buffer is freed immediately.) For this reason,
the bytes you pass to the NoCopy methods must have been allocated
using malloc."

Hamish
_______________________________________________

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: 
 >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>)
 >Re: Where's the buffer overrun? (From: Nick Zitzmann <email@hidden>)
 >Re: Where's the buffer overrun? (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Where's the buffer overrun?
  • Next by Date: Re: dataCellForTableColumn method
  • Previous by thread: Re: Where's the buffer overrun?
  • Next by thread: Re: Where's the buffer overrun?
  • Index(es):
    • Date
    • Thread