diff options
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r-- | include/asterisk/utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index edc01d4df..a417cf4d3 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -646,6 +646,15 @@ int _ast_vasprintf(char **ret, const char *file, int lineno, const char *func, c #endif /* AST_DEBUG_MALLOC */ +/*! + \brief call __builtin_alloca to ensure we get gcc builtin semantics + \param size The size of the buffer we want allocated + + This macro will attempt to allocate memory from the stack. If it fails + you won't get a NULL returned, but a SEGFAULT if you're lucky. +*/ +#define ast_alloca(size) __builtin_alloca(size) + #if !defined(ast_strdupa) && defined(__GNUC__) /*! * \brief duplicate a string in memory from the stack |