Re: The cost of using objects rather than plain C variables
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