I am accustom to retaining and releasing objects in Objective-C but since I am processing data through an Audio Unit I need to stay at the C level and cannot leverage the iOS framework. In this case I have a struct which holds onto audio data and I need to hold onto a bunch of them at a time. Once I am done I need to free up that memory.
I have been looking for a good tutorial on the memory management rules for C and structs but I have not found a good tutorial yet. (It’s hard to Google for sample C code.)
How should I manage C structs so that I can properly release the data? Do you know of a good tutorial on managing C structs?
There is nothing too fancy to do: malloc for allocation, and free for deallocation, always paired.
It more or less works as an Objective-C world without autorelease.