scope of malloc

Conor O'Neill conor at lion.inmos.co.uk
Wed Nov 14 00:37:57 AEST 1990


In article <2182 at kraftbus.opal.cs.tu-berlin.de> net at tubopal.UUCP (Oliver Laumann) writes:
>I'm not aware of any plausible reason why vendors should omit something
>as useful and simple to implement as alloca() from their UNIX systems.
>
>Yes, I know that alloca() may not work with certain existing C
>compilers, but why, for instance, can't vendors with such types of
>compilers add an option to support alloca() (like, e.g. Greenhills have
>done with their C compiler) or implement alloca() as a built-in function
>(like the SunOS cc does)?

On some machines you require a different calling sequence if you want
to be able to implement alloca than would be required if you do not
need to implement alloca. (This is due to the requirement for
both a stack pointer and a frame pointer).
The different calling sequences may have different costs.

Some customers would prefer a faster C system _without_ alloca than
a slower C system _with_ alloca.

---
Conor O'Neill, Software Group, INMOS Ltd., UK.
UK: conor at inmos.co.uk		US: conor at inmos.com
"It's state-of-the-art" "But it doesn't work!" "That is the state-of-the-art".



More information about the Comp.lang.c mailing list