Re: extaudiofileread stereo float (iOS)
Re: extaudiofileread stereo float (iOS)
- Subject: Re: extaudiofileread stereo float (iOS)
- From: Michael Tyson <email@hidden>
- Date: Sun, 26 Feb 2012 10:45:33 +0100
Haha, oh yeah - that's true, in that case (that's something that was happening outside core audio). There're plenty of times that instead of allocating memory, one is just pointing mData to some already-allocated stuff, though (or sometimes NULL, in the case of rendering the audio input).
Wow!! x/200 = Nice trick! That's brilliant!
On 26 Feb 2012, at 06:15, Brian Willoughby wrote: Your stack example still calls malloc() for the mData, so what is the advantage of the fragile code?
Coincidentally, I am porting some CoreMIDI code that I started writing way back in 2001 and 2002, and I had to remove various pack attributes to get it to compile with the more modern Xcode. Perhaps there is some obscure compiler option that I forgot to translate, but I rarely write code that is so dependent upon things that change from release to release. Thus, I still recommend that you stay far away from __attribute__((packed)) unless there is no other possible solution.
In this case, one additional malloc() when you're already using malloc() seems like no contest.
Brian Willoughby Sound Consulting
p.s. as for gdb, the "po" command is nice for objects, but the "x" command can do what NSData is doing much faster and with more configurability. Try "x/200 array" |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden