• 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: Vincent Habchi <email@hidden>
  • Date: Fri, 12 Jul 2013 08:41:37 +0200

Hi!

Sorry for this late answer, I was a bit swamped lately.

> 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.

In fact, I overlooked that completely. I just fear building a buffer from zero to something like 400,000 * 3 * 4 bytes = just under 5 MiB would imply too many moves as you mention.

Now, I am anyway moving towards a binary file that would be fed directly into the buffer rather than needing decoding, and partitioning it into several chunks in order to optimize the number of triangles displayed. I think I’ll use NSData to store these chunks.

Thanks to all for the precious help!
Vincent



_______________________________________________

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: Jean-Daniel Dupas <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>)
 >Re: The cost of using objects rather than plain C variables (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Custom drag image for NSTableView selections
  • 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