Re: Where's the buffer overrun?
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