This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: alloca and native code
Tom Tromey writes:
> >>>>> "Oskar" == Oskar Liljeblad <osk@hem.passagen.se> writes:
>
> Oskar> Is it ok to use alloca from native code?
>
> Yes. We use it sometimes in libjava. Even more frequently we use
> variable-sized arrays, since they are less of a hassle -- no need to
> test for and conditionally include <alloca.h>.
It would be nice if we didn't do this in embedded systems, since it
breaks the nice property that Java aprograms have small stacks, and
the stack is only scanned conservatively. We ought to question if
this is a performance win on any system.
Andrew.