Måns Rullgård <m...@mansr.com> wrote:
> Eric Wong <normalper...@yhbt.net> writes:
> 
> > Måns Rullgård <m...@mansr.com> wrote:
> >> This will leak memory like crazy.
> >
> > You're right. I somehow got spoiled into thinking it was
> > alloca-like from another project :x.
> 
> Never use such functions.  They are dangerous.

If it were alloca-only, yes.  The macro I was thinking of relied
on GC for larger allocations; and only used alloca for small ones.

> >> I'd prefer not to do a malloc/free for each block, but rather do it just
> >> once.  This will require a little more work, of course.
> >
> > Yes, it should be in the per-stream private data.  Will work on
> > it later today if you're busy.
> 
> OK, I'll leave it to you then.

So I didn't want to mess with the lsx_ms_adpcm_block_expand_i
signature for now.  I've made it use alloca for <= 1024 uses
and it'll only use the slow malloc+free path for the rare
128+ channel audio files.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

Reply via email to