Bearnip ->Lars ->Be ->alloca() for BeOS
Next: BYacc for BeOS

Be alloca() for BeOS

Screenshot: (none)
Release Date: 27. Mar 1999
Version: -
Author: D.A. Gwyn
Ported by: Lars Düning
- PGP Key

Requires BeOS version: R3
License: Public Domain
Cost: -
Source Available: Yes

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 ->Be ->alloca() for BeOS Lars Düning () - PGP Key
Next: BYacc for BeOS Validate this page.
Last update: Fri, 18 Jun 2004 22:48:57 -0600