alloca.h 941 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _ALLOCA_H
  2. #include <stdlib/alloca.h>
  3. # ifndef _ISOMAC
  4. #include <elf.h>
  5. #undef __alloca
  6. /* Now define the internal interfaces. */
  7. extern void *__alloca (size_t __size);
  8. #ifdef __GNUC__
  9. # define __alloca(size) __builtin_alloca (size)
  10. #endif /* GCC. */
  11. extern int __libc_use_alloca (size_t size) __attribute__ ((const));
  12. extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
  13. libc_hidden_proto (__libc_alloca_cutoff)
  14. #define __MAX_ALLOCA_CUTOFF 65536
  15. #include <allocalim.h>
  16. #if defined stackinfo_get_sp && defined stackinfo_sub_sp
  17. # define alloca_account(size, avar) \
  18. ({ void *old__ = stackinfo_get_sp (); \
  19. void *m__ = __alloca (size); \
  20. avar += stackinfo_sub_sp (old__); \
  21. m__; })
  22. #else
  23. # define alloca_account(size, avar) \
  24. ({ size_t s__ = (size); \
  25. avar += s__; \
  26. __alloca (s__); })
  27. #endif
  28. # endif /* !_ISOMAC */
  29. #endif