Alfred E. Heggestad
2005-Dec-03 09:20 UTC
[Speex-dev] [PATCH] Robust handling of low-memory conditions
Hi here is a patch adding robust handling of low-memory conditions (return value of speex_alloc() is checked) for nb_celp.c, sb_celp.c and preprocess.c - jitter/echo is not updated. http://db.org/~alfredh/patch/speex-oom-1.diff I have tested this in my low-memory environment, allocating decoders/encoders for all heap values between 1 and X with no memory leaks. Some data is here: sample rate: 8000 Hz heap free threshold: 9652 bytes (Pre-processor disabled) heap free threshold: 27392 bytes (Pre-processor enabled) result: OK (no leaks) sample rate: 16000 Hz heap free threshold: 27916 bytes (Pre-processor disabled) heap free threshold: 62936 bytes (Pre-processor enabled) result: OK (no leaks) sample rate: 32000 Hz heap free threshold: 62340 bytes (Pre-processor disabled) heap free threshold: 131920 bytes (Pre-processor enabled) pre-processor: disable result: OK (no leaks) (the heap free threshold value indicates how much heap must be available to allocate one Speex encoder+decoder with the given parameters) /alfred -- --------------------- Alfred E. Heggestad Owera AS sip:alfredh@owera.com ---------------------