summaryrefslogtreecommitdiff
path: root/include/asterisk/utils.h
AgeCommit message (Collapse)Author
2006-04-12add 'show threads' and 'show profile' commands.Luigi Rizzo
These are momstly debugging tools for developers, a bit documented in the header files (utils.h), although more documentation is definitely necessary. The performance impact is close to zero(*) so there is no need to compile it conditionally. (*) not completely true - thread destruction still needs to search a list _but_ this can be easily optimized if we end up with hundreds of active threads (in which case, though, the problem is clearly elsewhere). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-19When astmm is in use, define ast_malloc and friends to malloc, etc., so thatRussell Bryant
it doesn't report that all allocations are coming from utils.h. Also, add some more information to the error message astmm reports when a memory allocation failure occurs. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-24Reverting revision 10998 that was accidentaly committed to trunk. My apologies.Olle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-24Update to trunkOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-03Bug 6322 - Implementation of SHA1 in Asterisk (plus dialplan function to use it)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21don't do the memcpy inside of ast_strdupa if we know that __builtin_alloca Russell Bryant
was not successful git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-21remove optimization where its benefits are negligibleRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-20- move ast_strdupa from channel.h to utils.hRussell Bryant
- 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: https://origsvn.digium.com/svn/asterisk/trunk@8356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-13Various cleanups from comments in an email from Luigi Rizzo. Thank you!Russell Bryant
- Use a cleaner syntax for declaring the allocation macros - Fix return value for ast_strdup/ast_strndup - remove safe_strdup from app_macro, since ast_strup does the same thing - fix a place in app_queue where ast_calloc+strncpy was used instead of ast_strdup. If you are helping out with these conversions, please watch out for other places where this is done. - add a note to the coding guidelines about the fix to app_queue git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-10Add wrappers for commonly used memory allocation functions. These wrappersRussell Bryant
add an automatically generated Asterisk log message if the allocation fails for some reason. Otherwise, they are functionally the same, with the exception of ast_strdup and ast_strndup. These functions have the added ability to accept a NULL argument without error, which will just be ignored without generating an error. The coding guidelines have also been updated to reflect all of this information. (issue #4996) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-10Bug 5961 - new RAND() functionTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-01-04add memory-pool based string field management for structuresKevin P. Fleming
convert chan_sip sip_pvt and sip_registry structures to use string fields add 'const' qualifiers to a few API calls that don't modify their input strings add an asprintf() wrapper to astmm git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29remove extraneous svn:executable propertiesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-08issue #5569 minus lock.h changesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-01add new GCC-specific macro and force inlining of certain functions where ↵Kevin P. Fleming
speed is paramount, even when optimization is disabled git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-31don't pass short arguments by value, it will cause compiler warnings on most ↵Kevin P. Fleming
platforms about implicit conversions (thanks Luigi!) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-29do saturated math properly (thanks to the eagle-eyes of Tony Mountifield)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-28ensure that SLINEAR volume adjustments don't wrap around short integer maximumsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-24Doxygen documentation update from oej (issue #5505)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-16More utility cleanupsMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-23move process_quotes_and_slashes to utils.c since it is used by both pbx_ael ↵Russell Bryant
and pbx_config clean up some formatting remove some commented out reference code move unload_module in pbx_ael down to be with the rest of the standard module functions git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-09-08first set of Cygwin portability stuff (issue #4678)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-30major header file cleanup: license, copyrights, descriptions, markers, etc.Kevin P. Fleming
remove deprecated config_old.c/config_old.h remove unused cvsid.h git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-29encode/decode URIs in 'pedantic' mode (issue #3923)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-19split acl and netsock code into separate files, in preparation for new ↵Kevin P. Fleming
netsock implementation various minor cleanups git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-11simplify (and document!) macro for inlinable API functions (inspired by bug ↵Kevin P. Fleming
#4603, with slightly different implementation) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-24split up string/time functions into separate header filesKevin P. Fleming
make more LOW_MEMORY optimizations, and ensure that a non-inline version of each inlinable function is always available (for external modules) move compiler-specific stuff into a separate header file git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-23make inlinable functions only need the function body in one file, and ↵Kevin P. Fleming
respond properly to LOW_MEMORY being defined make ast_copy_string inlinable, and ast_tvdiff_ms LOW_MEMORY aware git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-18Fix up utils nonsenseMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-17string/whitespace handling cleanups (bug #4449, with mods)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-14don't use pthread_mutex_lockKevin P. Fleming
don't double-include pthread.h in utils.h, which can cause the pthread_mutex_lock warning to not be generated on some systems git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-09move timeval-diff function into utils.h from app_alarmreceiver.cKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-06-07header ordering fixes for FreeBSD (pending a global merge into asterisk.h) ↵Kevin P. Fleming
(bug #4484) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-20make IF dialplan function handle quoted strings properly (bug #4322, with ↵Kevin P. Fleming
API mods) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-15add ast_build_string library function (from bug #3644)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-02add experimental ast_copy_string() function to be used in place of strncpy() ↵Kevin P. Fleming
(see discussion on asterisk-dev) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-21use double-quotes instead of angle-brackets for non-system include files ↵Kevin P. Fleming
(bug #4058) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-17Add support for Solaris/x86 (bug #3064)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-05Make mpg123 behave more nicelyMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-04Fix stack size for ADSI (needs 128k by itself!)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-04Make stack size be selectableMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-03Fix stack size (take 2) (bug #3706)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-03Support > 300 threads on x86-32 and other 32-bit systemsMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-02-18Add OEJ's md5 app (bug #3604)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-26Fix C++ issues (bug #'s 3425, 3426)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-21update copyright headers for 2005Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-20Fix ODBC to clear title each time (bug #3379)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-15Make groups be 64-bits (bug #3351, with mods)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-10More flagification, courtesy drumkilla (bug #3280)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-08Warn if flags is signed instead of unsigned (bug #3279)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4713 65c4cc65-6c06-0410-ace0-fbb531ad65f3