aboutsummaryrefslogtreecommitdiffstats
path: root/utils/hashtest2.c
AgeCommit message (Collapse)AuthorFilesLines
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)tilghman1-0/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-25This is basically a complete rollback of r155401, as it was determined thatseanbright1-5/+5
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158959 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-07Add ability to pass arbitrary data to the ao2_callback_fn (called fromseanbright1-5/+5
ao2_callback and ao2_find). Currently, passing OBJ_POINTER to either of these mandates that the passed 'arg' is a hashable object, making searching for an ao2 object based on outside criteria difficult. Reviewed by Russell and Mark M. via ReviewBoard: http://reviewboard.digium.com/r/36/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@155401 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-29Merged revisions 140488 via svnmerge from mmichelson1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r140488 | mmichelson | 2008-08-29 12:34:17 -0500 (Fri, 29 Aug 2008) | 22 lines After working on the ao2_containers branch, I noticed something a bit strange. In all cases where we provide a callback function to ao2_container_alloc, the callback function would only return 0 or CMP_MATCH. After inspecting the ao2_callback() code carefully, I found that if you're only looking for one specific item, then you should return CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue traversing the current bucket until the end searching for more matches. In cases like chan_iax2 where in 1.4, all the peers are shoved into a single bucket, this makes for potentially terrible performance since the entire bucket will be traversed even if the peer is one of the first ones come across in the bucket. All the changes I have made were for cases where the callback function defined was passed to ao2_container_alloc so that calls to ao2_find could find a unique instance of whatever object was being stored in the container. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@140489 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23A new feature thanks to the fine folks at Switchvox!mmichelson1-0/+17
If a deadlock is detected, then the typical lock information will be printed along with a backtrace of the stack for the offending threads. Use of this requires compiling with DETECT_DEADLOCKS and having glibc installed. Furthermore, issuing the "core show locks" CLI command will print the normal lock information as well as a backtraces for each lock. This requires that DEBUG_THREADS is enabled and that glibc is installed. All the backtrace features may be disabled by running the configure script with --without-execinfo as an argument git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118173 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-21This change makes it so that logs will report the correct source of verbose ↵mmichelson1-1/+1
messages. Until this change, all verbose messages in Asterisk's log files reported logger.c as the source of the message. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117693 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-10Merged revisions 114051 via svnmerge from mmichelson1-2/+6
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines Fix 1.4 build when LOW_MEMORY is enabled. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114052 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21more header removal/normalizationrizzo1-2/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89473 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-17add a return NULL to a function that is expected to return a valuerizzo1-0/+1
so compilers that don't understand that this code is NOTREACHED will not complain (the fault is not much on the compiler but on the declaration of pthread_exit on certain platforms) s/certain platform/cygwin/ if you are really curious git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89368 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-9/+0
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29UGH... while trying to fix #10995, I found all kinds of cruft in this ↵kpfleming1-19/+8
Makefile. It should all be gone now, and as a side effect hashtest2 now builds with --enable-dev-mode enabled without a host of errors git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87498 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17and then, I noticed the clicompat stuff.murf1-16/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17more stub routines to allow linkage in stand-alone environment, with thread ↵murf1-0/+16
debugs turned on git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86180 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08Fix up tree so that it compiles when MTX Profiling is enabled.file1-0/+2
(closes issue #10898) Reported by: snuffy Patches: 10898-mtx_prof.diff uploaded by qwell (license 4) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85025 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-22Fix build of check_expr and hashtest2 when DEBUG_THREADLOCAL is definedtilghman1-8/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83545 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Change the traversal to use ao2_callback() instead of an ao2_iterator. Usingrussell1-5/+6
ao2_callback() is a much more efficient way of performing an operation on every item in the container. This change makes hashtest2 run in about 25% of the time it ran before on my system. In general, I would say that it makes the most sense to use an ao2_iterator if the operation being performed is going to take a long time and you don't want to keep the container locked while you work with each object. Otherwise, the use of ao2_callback is preferred. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82282 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Include compat.h to hopefully make it compatible with FreeBSD.file1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82234 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Fix building under FreeBSD. Make sure alloca.h exists before including it.file1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82233 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10Committing my test for astobj2, hashtest2.c, along with makefile changes in ↵murf1-0/+399
utils. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82140 f38db490-d61c-443f-a65b-d21fe96a405b