In my audioCallback I use the AudioSampleBuffer class a lot to reference already existing audio data (so it’s already allocated), using AudioSampleBuffer (float** dataToReferTo, int numChannels, int numSamples).
Upon deletion, AudioSampleBuffer deletes a HeapBlock which again leads to a call of free() (and ofcourse its constructor also malloc’ed). Not exactly good if you have a AudioSampleBuffer in your audioCallback. Here it ruined all performances.
Since JUCE relies heavily on AudioSampleBuffer, this can cause heavy potential problems.
[code] ILSequencer.exe!free(void * pUserData=0x00000000) Line 49 + 0xb bytes C++
ILSequencer.exe!juce::HeapBlock<char,1>::~HeapBlock<char,1>() Line 119 + 0xb bytes C++
ILSequencer.exe!juce::AudioSampleBuffer::~AudioSampleBuffer() Line 147 + 0x19 bytes C++
ILSequencer.exe!MainController::audioDeviceIOCallback(const float * * inputChannelData=0x06bc5ec8, int numInputChannels=0x00000002, float * * outputChannelData=0x06bc6e30, int numOutputChannels=0x00000002, int numSamples=0x000001c0) Line 624 + 0x1e bytes C++[/code]
Erm… no, it’s always been the same. The class has to allocate memory, so it has to call malloc, there was never a version that didn’t do so. In fact the older versions used to make more calls to malloc than the current one does.
No. Try stepping through the code and see what really happens in there.
Why would AudioSampleBuffer need to allocate memory when used with the constructor AudioSampleBuffer (float** dataToReferTo, int numChannels, int numSamples) ?? I’ve been clearly saying that I am only referencing pre-allocated memory, and not letting AudioSampleBuffer allocate anything!
Ah, sorry then! I have to skim these forum posts pretty quickly, you know!
Just looking at your first stack trace again, the “free” call is actually freeing a null pointer, so surely the standard library won’t invoke a lock if you pass it a null pointer… would it??
Last question: Is there any way to alert when calls to free/malloc/new/delete are made in the audio thread? It would help a lot if that would be possible.