added a new method rs_malloc that checks its arguments and prints a stacktrace on error/weird call. Changed the code everywhere to use this instead of malloc. Removed some mallocs and replaced with RsTemporaryMemory

This commit is contained in:
csoler 2016-01-12 21:10:11 -05:00
parent 9c6e7dfc13
commit d13526facd
39 changed files with 274 additions and 132 deletions

View file

@ -1,5 +1,6 @@
#include "SpeexProcessor.h"
#include <util/rsmemory.h>
#include <speex/speex.h>
#include <speex/speex_preprocess.h>
@ -350,7 +351,11 @@ void SpeexOutputProcessor::putNetworkPacket(QString name, QByteArray packet) {
if (userJitterHash.contains(name)) {
userJitter = userJitterHash.value(name);
} else {
userJitter = (SpeexJitter*)malloc(sizeof(SpeexJitter));
userJitter = (SpeexJitter*)rs_safe_malloc(sizeof(SpeexJitter));
if(!userJitter)
return ;
speex_jitter_init(userJitter, speex_decoder_init(&speex_wb_mode), SAMPLING_RATE);
int on = 1;
speex_decoder_ctl(userJitter->dec, SPEEX_SET_ENH, &on);