Re: NSData questions (including Altivec)
Re: NSData questions (including Altivec)
- Subject: Re: NSData questions (including Altivec)
- From: "Sean McBride" <email@hidden>
- Date: Mon, 20 Sep 2004 20:32:10 -0400
Nicko van Someren (email@hidden) on Mon, Sep 20, 2004 11:08 said:
>> 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.
>
>There is no such guarantee in the documentation so I would suggest that
>even if it appears to do the right thing that you don't count on it.
man malloc says:
"The malloc(), calloc(), valloc(), and realloc() functions allocate
memory. The allocated memory is aligned such that it can be used for any
data type, including AltiVec-related types." I believe the OP is right.
There is also valloc() which does page alignments.
_______________________________________________
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