3 #include <stdlib/alloca.h>
11 /* Now define the internal interfaces. */
12 extern void *__alloca (size_t __size
);
15 # define __alloca(size) __builtin_alloca (size)
18 extern int __libc_use_alloca (size_t size
) __attribute__ ((const));
19 extern int __libc_alloca_cutoff (size_t size
) __attribute__ ((const));
20 libc_hidden_proto (__libc_alloca_cutoff
)
22 #define __MAX_ALLOCA_CUTOFF 65536
24 #include <allocalim.h>
26 #ifndef stackinfo_alloca_round
27 # define stackinfo_alloca_round(l) (((l) + 15) & -16)
31 # define extend_alloca(buf, len, newlen) \
32 (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \
33 char *__newbuf = __alloca (__newlen); \
34 if (__newbuf + __newlen == (char *) (buf)) \
40 # define extend_alloca(buf, len, newlen) \
41 (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \
42 char *__newbuf = __alloca (__newlen); \
43 char *__buf = (char *) (buf); \
44 if (__buf + len == __newbuf) \
53 # define extend_alloca(buf, len, newlen) \
54 __alloca (((len) = (newlen)))
57 #if defined stackinfo_get_sp && defined stackinfo_sub_sp
58 # define alloca_account(size, avar) \
59 ({ void *old__ = stackinfo_get_sp (); \
60 void *m__ = __alloca (size); \
61 avar += stackinfo_sub_sp (old__); \
63 # define extend_alloca_account(buf, len, newlen, avar) \
64 ({ void *old__ = stackinfo_get_sp (); \
65 void *m__ = extend_alloca (buf, len, newlen); \
66 avar += stackinfo_sub_sp (old__); \
69 # define alloca_account(size, avar) \
70 ({ size_t s__ = (size); \
73 # define extend_alloca_account(buf, len, newlen, avar) \
74 ({ size_t s__ = (newlen); \
76 extend_alloca (buf, len, s__); })
79 # endif /* !_ISOMAC */