diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-20 19:24:42 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-20 19:24:42 +0000 |
commit | 834f1b57898c31c92aa60d7ab9dc6ab8dea0e206 (patch) | |
tree | 604e6ab5b89c6ad12370245015699b0e5991f6f5 /include/asterisk/channel.h | |
parent | ae8c68e98db8d72d26fa86c995dbf639d7b57a6c (diff) |
- move ast_strdupa from channel.h to utils.h
- attempt to log an error message if the __builtin_alloca inside of ast_strdupa
fails.
- document the fact that it is known and intended behavior for ast_strdupa to
cause Asterisk to crash if the alloca fails
- use __builtin_expect when checking for allocation failure in all of the
allocation wrappers
New Janitor Project! Anywhere that we check for a successful allocation after
a call to ast_strdupa is unnecessary and should be removed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8356 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r-- | include/asterisk/channel.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 6121481d0..449b38e0f 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -1174,17 +1174,6 @@ static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, #endif } -#if !defined(ast_strdupa) && defined(__GNUC__) -# define ast_strdupa(s) \ - (__extension__ \ - ({ \ - __const char *__old = (s); \ - size_t __len = strlen (__old) + 1; \ - char *__new = (char *) __builtin_alloca (__len); \ - (char *) memcpy (__new, __old, __len); \ - })) -#endif - #ifdef DO_CRASH #define CRASH do { fprintf(stderr, "!! Forcing immediate crash a-la abort !!\n"); *((int *)0) = 0; } while(0) #else |