]>
Commit | Line | Data |
---|---|---|
6796bc80 UD |
1 | #ifndef _ALLOCA_H |
2 | ||
28f540f4 | 3 | #include <stdlib/alloca.h> |
47755784 ZW |
4 | |
5 | # ifndef _ISOMAC | |
6 | ||
832737d5 | 7 | #include <stackinfo.h> |
bdbf022d UD |
8 | |
9 | #undef __alloca | |
10 | ||
11 | /* Now define the internal interfaces. */ | |
c19559b0 | 12 | extern void *__alloca (size_t __size); |
bdbf022d UD |
13 | |
14 | #ifdef __GNUC__ | |
15 | # define __alloca(size) __builtin_alloca (size) | |
16 | #endif /* GCC. */ | |
6796bc80 | 17 | |
6166815d UD |
18 | extern int __libc_use_alloca (size_t size) __attribute__ ((const)); |
19 | extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const)); | |
a85b5cb4 | 20 | libc_hidden_proto (__libc_alloca_cutoff) |
6166815d UD |
21 | |
22 | #define __MAX_ALLOCA_CUTOFF 65536 | |
23 | ||
24 | #include <allocalim.h> | |
25 | ||
fd537e53 UD |
26 | #if defined stackinfo_get_sp && defined stackinfo_sub_sp |
27 | # define alloca_account(size, avar) \ | |
34a9094f UD |
28 | ({ void *old__ = stackinfo_get_sp (); \ |
29 | void *m__ = __alloca (size); \ | |
30 | avar += stackinfo_sub_sp (old__); \ | |
31 | m__; }) | |
fd537e53 UD |
32 | #else |
33 | # define alloca_account(size, avar) \ | |
34a9094f UD |
34 | ({ size_t s__ = (size); \ |
35 | avar += s__; \ | |
647925b2 | 36 | __alloca (s__); }) |
fd537e53 UD |
37 | #endif |
38 | ||
47755784 | 39 | # endif /* !_ISOMAC */ |
6796bc80 | 40 | #endif |