[vorbis-dev] alloca() problem with CodeWarrior

Phil Burk philburk at softsynth.com
Fri Mar 15 08:54:37 PST 2002



Sorry to have stirred up such a controversy. The only reason I care about
this is because I think Ogg Vorbis is really great and I want to see it
running on as many platforms as possible.

<p>> The common denominator in this case would degrade performance and
> significantly increase memory usage due to heap fragmentation.
> Installing the bloody compiler patches (or finding a working alloca())
> is the correct solution.

I agree that malloc() and free() is slower than alloca(). But there are
alternatives. If the maximum sizes are known when the encoder starts up then
working buffers can be allocated at the top level. The pointers can then be
passed down to the lower level routines in a context structure. This has the
disadvantage of having more parameters to pass. But it also gives the
implementor more flexibility. On embedded systems, for example, some buffers
could be allocated in local on-chip static RAM instead of SDRAM. This cannot
be done when using alloca().

Also on embedded systems, there is less chance of having a working alloca().

Phil Burk

<p><p>--- >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 at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list