Mercurial > emacs
comparison src/alloca.c @ 51551:34f0347e6e45
(alloca): Declare arg as size_t.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 12 Jun 2003 22:09:14 +0000 |
parents | e6d6dc2aa074 |
children | 26b0352eaa49 |
comparison
equal
deleted
inserted
replaced
51550:5ffaa82e4d48 | 51551:34f0347e6e45 |
---|---|
1 /* alloca.c -- allocate automatically reclaimed memory | 1 /* alloca.c -- allocate automatically reclaimed memory |
2 (Mostly) portable public-domain implementation -- D A Gwyn | 2 (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. | |
3 | 6 |
4 This implementation of the PWB library alloca function, | 7 This implementation of the PWB library alloca function, |
5 which is used to allocate space off the run-time stack so | 8 which is used to allocate space off the run-time stack so |
6 that it is automatically reclaimed upon procedure exit, | 9 that it is automatically reclaimed upon procedure exit, |
7 was inspired by discussions with J. Q. Johnson of Cornell. | 10 was inspired by discussions with J. Q. Johnson of Cornell. |
52 */ | 55 */ |
53 # ifndef STACK_DIRECTION | 56 # ifndef STACK_DIRECTION |
54 you | 57 you |
55 lose | 58 lose |
56 -- must know STACK_DIRECTION at compile-time | 59 -- must know STACK_DIRECTION at compile-time |
57 /* Using #error here is not wise since this file is for | 60 /* Using #error here is not wise since this file should work for |
58 old and obscure compilers. */ | 61 old and obscure compilers. */ |
59 # endif /* STACK_DIRECTION undefined */ | 62 # endif /* STACK_DIRECTION undefined */ |
60 # endif /* static */ | 63 # endif /* static */ |
61 # endif /* emacs */ | 64 # endif /* emacs */ |
62 | 65 |
178 caller, but that method cannot be made to work for some | 181 caller, but that method cannot be made to work for some |
179 implementations of C, for example under Gould's UTX/32. */ | 182 implementations of C, for example under Gould's UTX/32. */ |
180 | 183 |
181 pointer | 184 pointer |
182 alloca (size) | 185 alloca (size) |
183 unsigned size; | 186 size_t size; |
184 { | 187 { |
185 auto char probe; /* Probes stack depth: */ | 188 auto char probe; /* Probes stack depth: */ |
186 register char *depth = ADDRESS_FUNCTION (probe); | 189 register char *depth = ADDRESS_FUNCTION (probe); |
187 | 190 |
188 # if STACK_DIRECTION == 0 | 191 # if STACK_DIRECTION == 0 |