• 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: NSData Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSData Questions (From: Eric Hermanson <email@hidden>)

  • Prev by Date: Re: Trouble with event taps...
  • Next by Date: Re: Implementing key view loop in custom NSView
  • Previous by thread: Re: NSData Questions
  • Next by thread: Re: NSData Questions
  • Index(es):
    • Date
    • Thread