Version: - Author: D.A. Gwyn Ported by: Lars Düning E-mail: - PGP Key |
Screenshot: (none)
Requires BeOS version: R3 |
Download (http) (4KB) from Bearnip (US). |
When porting programs (especially from the Unix world) one often has the problem that the program in questions assumes an unlimited stack and uses alloca() to store everything and the kitchen sink. Rewriting the programs to use other means of storage allocation is not always an option - at which point this alloca() simulation comes in handy.
The simulated alloca() is written in Standard C, you just have to add it to the programs sources, compile and link it. Please see the head comment of the source for some usage tips.
To use the simulated alloca() with BeOS programs you have to be aware
that both GNU C and Metrowerks use an optimized form of alloca() which
does not translate into a function call. To make alloca() work with
these compilers, you have to add the line #undef alloca
after
every #include <alloca.h>
in your program - the
undef
will turn off the
compiler magic and cause the compilers to create proper function calls.
Bearnip
![]() ![]() ![]() |
Lars Düning () - PGP Key |
Next: BYacc for BeOS | Validate this page. |
Last update: Fri, 18 Jun 2004 22:48:57 -0600 |