Hi, I was wondering why the decoder does so much malloc/alloca/free within the inner decoding stages. Allocating everything at the xxx_look() stages would: - ensure that on exit of the look stage the decoder as grabbed once and for all the resources required to decode the stream to the end. - allows to perform checks on memory allocations, something which is completely lacking at the moment. - be more efficient. André --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
At 10:05 AM 9/3/02 +0200, you wrote:>Hi, > >I was wondering why the decoder does so much malloc/alloca/free >within the inner decoding stages. Allocating everything at >the xxx_look() stages would: > >- ensure that on exit of the look stage the decoder as grabbed > once and for all the resources required to decode the stream > to the end. > >- allows to perform checks on memory allocations, something > which is completely lacking at the moment. > >- be more efficient.It shouldn't (once it reaches steady-state, at least, which will be after a packet or two) be allocating any memory during decoding. If it is, that's a (relatively new) bug. Mike --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> -----Original Message----- > From: Michael Smith [SMTP:msmith@labyrinth.net.au] > Sent: Tuesday, September 03, 2002 11:21 AM > To: vorbis-dev@xiph.org > Subject: Re: [vorbis-dev] memory allocations in codec > > At 10:05 AM 9/3/02 +0200, you wrote: > >Hi, > > > >I was wondering why the decoder does so much malloc/alloca/free > >within the inner decoding stages. Allocating everything at > >the xxx_look() stages would: > > > >- ensure that on exit of the look stage the decoder as grabbed > > once and for all the resources required to decode the stream > > to the end. > > > >- allows to perform checks on memory allocations, something > > which is completely lacking at the moment. > > > >- be more efficient. > > It shouldn't (once it reaches steady-state, at least, which will > be after a packet or two) be allocating any memory during decoding. > If it is, that's a (relatively new) bug. >I am not talking about the packet buffering stuff but about allocations in xxx_inversex() functions like: float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1)); in the middle of floor0_inverse1(). Well, ok it's not a malloc nor an alloca(). ;-) André --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
TIMMERMANS ANDRE wrote:> > Hi, > > I was wondering why the decoder does so much malloc/alloca/free > within the inner decoding stages. Allocating everything at > the xxx_look() stages would: > > - ensure that on exit of the look stage the decoder as grabbed > once and for all the resources required to decode the stream > to the end. > > - allows to perform checks on memory allocations, something > which is completely lacking at the moment. > > - be more efficient.alloca() is more efficient than memory allocated for just one purpose :) <p>Segher --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Apparently Analagous Threads
- [LLVMdev] Questions about attaching DWARF source code debugging information to generated LLVM-IR.
- [LLVMdev] Questions about attaching DWARF source code debugging information to generated LLVM-IR.
- Why LSP?
- FLOAT_LOOKUP version of lsp_to_curve
- avoid error within for loop, try, trycatch, while, move to next iteration, unlist