1 |
/* alloca.c -- allocate automatically reclaimed memory |
/* alloca.c -- allocate automatically reclaimed memory |
2 |
(Mostly) portable public-domain implementation -- D A Gwyn |
(Mostly) portable public-domain implementation -- D A Gwyn |
3 |
|
|
4 |
|
NOTE: The canonical source of this file is maintained with gnulib. |
5 |
|
Bugs can be reported to bug-gnulib@gnu.org. |
6 |
|
|
7 |
This implementation of the PWB library alloca function, |
This implementation of the PWB library alloca function, |
8 |
which is used to allocate space off the run-time stack so |
which is used to allocate space off the run-time stack so |
9 |
that it is automatically reclaimed upon procedure exit, |
that it is automatically reclaimed upon procedure exit, |
57 |
you |
you |
58 |
lose |
lose |
59 |
-- must know STACK_DIRECTION at compile-time |
-- must know STACK_DIRECTION at compile-time |
60 |
/* Using #error here is not wise since this file is for |
/* Using #error here is not wise since this file should work for |
61 |
old and obscure compilers. */ |
old and obscure compilers. */ |
62 |
# endif /* STACK_DIRECTION undefined */ |
# endif /* STACK_DIRECTION undefined */ |
63 |
# endif /* static */ |
# endif /* static */ |
183 |
|
|
184 |
pointer |
pointer |
185 |
alloca (size) |
alloca (size) |
186 |
unsigned size; |
size_t size; |
187 |
{ |
{ |
188 |
auto char probe; /* Probes stack depth: */ |
auto char probe; /* Probes stack depth: */ |
189 |
register char *depth = ADDRESS_FUNCTION (probe); |
register char *depth = ADDRESS_FUNCTION (probe); |