NSData questions (including Altivec)
NSData questions (including Altivec)
- Subject: NSData questions (including Altivec)
- From: Paul Sargent <email@hidden>
- Date: Mon, 20 Sep 2004 09:20:17 +0100
Hi all,
I'm currently writing some code that does some calculations on large
amounts of binary data. I was going to handle this binary data myself
by writing a small container class to allocate memory and hold a few
key bits of information about it, such as the size of the contained
type and length of the buffer, but then I realised that this isn't that
far off NSData.
So I've got a few questions about NSData that I can't seem to find
answers to in the Reference Library.
1) Does anybody know whether NSData guarantees to allocate memory for
it's buffer with 16-byte alignment so that altivec code can be used on
it? I'm assuming it uses malloc() for it's allocation, and malloc()
appears to guarantee this.
2) Is it against the spirit of NSData to be modifying the data in the
buffer via the pointer given by the bytes method? i.e. When you use a
NSMuableData, is it just the attributes of the buffer which gain
mutability or is it the buffer itself as-well?
3) When using SetLength, IncreaseLength and AppendBytes, I would assume
that it's possible for the buffer to change location. Therefore it's
best to use the mutableBytes method to get a new pointer whenever
there's a possibility it changed. Correct?
Thanks
Paul
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden