• 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: The cost of using objects rather than plain C variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The cost of using objects rather than plain C variables


  • Subject: Re: The cost of using objects rather than plain C variables
  • From: Andy Lee <email@hidden>
  • Date: Mon, 08 Jul 2013 13:20:33 -0400

On Jul 8, 2013, at 12:30 PM, Vincent Habchi <email@hidden> wrote:

> On 8 juil. 2013, at 18:04, Jens Alfke <email@hidden> wrote:
>> On Jul 7, 2013, at 1:37 PM, Frederick Bartram <email@hidden> wrote:
>>
>>> Have you tried using NSData to store C-arrays?
>
> No, since my initial problem was to be able to extend the buffer as the number of primitive read grew. NSData would not do that.

NSData wouldn't let you, but NSMutableData would, with methods like appendBytes:length:, appendData:, increaseLengthBy:, etc.  The underlying buffer might have to move around if it cannot be extended in place, just as it would if you use C realloc() calls.

--Andy


_______________________________________________

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: The cost of using objects rather than plain C variables
      • From: Vincent Habchi <email@hidden>
References: 
 >Re: The cost of using objects rather than plain C variables (From: Jens Alfke <email@hidden>)
 >Re: The cost of using objects rather than plain C variables (From: Vincent Habchi <email@hidden>)

  • Prev by Date: Re: The cost of using objects rather than plain C variables
  • Next by Date: Re: The cost of using objects rather than plain C variables
  • Previous by thread: Re: The cost of using objects rather than plain C variables
  • Next by thread: Re: The cost of using objects rather than plain C variables
  • Index(es):
    • Date
    • Thread