[vorbis-dev] alloca() problem with CodeWarrior

Segher Boessenkool segher at chello.nl
Thu Mar 14 16:44:27 PST 2002



> The alloca() function is used throughout the Vorbis code base. In my Google
> searches, I saw many cases where alloca() caused problems on many machines.
> It is often implemented incorrectly by compilers.

A lot of things are implemented incorrectly by compilers.

> Plus it requires lots of stack space.

It does not waste stack space.  It *uses* stack space.  This is a *good* thing,
and exactly why alloca() is useful.  Variable length arrays would be even
better, but those are a C99 feature.  More compilers have trouble with
C99 than
with alloca().

> There was a discussion a while back about removing alloca()
> calls from Ogg Vorbis. I would like to add one vote for that mod.

I vote against.  People having trouble with alloca() can always use one of
the portable C implementations of it (like the one in libiberty, for example).

<p>Segher

<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