Re: NSData Questions
Re: NSData Questions
- Subject: Re: NSData Questions
- From: "Sean McBride" <email@hidden>
- Date: Mon, 10 Aug 2009 12:47:42 -0400
- Organization: Rogue Research Inc.
On 8/8/09 5:45 PM, Eric Hermanson said:
>1. Is it more efficient to malloc a uint8_t array and call NSData
>'init no copy', rather than pass in an array allocated with a fixed
>length on the stack to the init method that makes a copy of the bytes?
More efficient according to which metric? Memory usage? CPU time?
Code readability?
If you ever want to support garbage collection, I suggest this usage:
- [NSMutableData dataWithCapacity:numBytes];
- mutableBytes to get pointer
- fill with your data
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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