I'm trying to use malloc to create some memory for an audio buffer for Remote IO. It works the vast most of the time. But recently it's been crashing on some iOS 6.0.1 through 6.1.3, strangely on iPhone 5 and iPad 3-4, iPad 3-5, and iPad 3-6.
The size of the buffer is below. Isn't it odd that the higher performance devices would crash on this? Is it because they're used more aggressively?
My thought on how to fix it, is to trap this attempt with a catch, and then on error try half the size. This normally provides for 30 seconds of "listening" through the mic.
THANKS!!
Ron
int num_transfer_buffer_samples = 655350;
transferBuffer = malloc((num_transfer_buffer_samples) * sizeof(float)); // CRASH