aboutsummaryrefslogtreecommitdiffstats
path: root/main/astmm.c
AgeCommit message (Collapse)AuthorFilesLines
2008-07-11simplify calculationkpfleming1-3/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@129967 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11fix a flaw found while experimenting with structure alignment and padding; ↵kpfleming1-1/+19
low-fence checking would not work properly on 64-bit platforms, because the compiler was putting 4 bytes of padding between the fence field and the allocation memory block added a very obvious runtime warning if this condition reoccurs, so the developer who broke it can be chastised into fixing it :-) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@129966 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29Remove a lock that doesn't make any sense. The regions lock needs to be heldrussell1-3/+2
when traversing the list of allocated chunks so that they can be printed out to the CLI. (Thanks to eliel on #asterisk-dev for pointing this out!) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87373 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Minor FreeBSD build fixtilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@86787 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-03Add some improvements to lock debugging. These changes take effectrussell1-1/+1
with DEBUG_THREADS enabled and provide the following: * This will keep track of which locks are held by which thread as well as which lock a thread is waiting for in a thread-local data structure. A reference to this structure is available on the stack in the dummy_start() function, which is the common entry point for all threads. This information can be easily retrieved using gdb if you switch to the dummy_start() stack frame of any thread and print the contents of the lock_info variable. * All of the thread-local structures for keeping track of this lock information are also stored in a list so that the information can be dumped to the CLI using the "core show locks" CLI command. This introduces a little bit of a performance hit as it requires additional underlying locking operations inside of every lock/unlock on an ast_mutex. However, the benefits of having this information available at the CLI is huge, especially considering this is only done in DEBUG_THREADS mode. It means that in most cases where we debug deadlocks, we no longer have to request access to the machine to analyze the contents of ast_mutex_t structures. We can now just ask them to get the output of "core show locks", which gives us all of the information we needed in most cases. I also had to make some additional changes to astmm.c to make this work when both MALLOC_DEBUG and DEBUG_THREADS are enabled. I disabled tracking of one of the locks in astmm.c because it gets used inside the replacement memory allocation routines, and the lock tracking code allocates memory. This caused infinite recursion. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@78095 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-14Add missing newlines for two memory CLI commands.file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@50820 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27allow 'show memory' and 'show memory summary' to distinguish memory ↵kpfleming1-18/+55
allocations that were done for caching purposes, so they don't look like memory leaks git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48987 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20Fix the total allocation count and total byte count in the memory summaryrussell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43383 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20Fix the memory summary so that it doesn't print the first file in the list overrussell1-2/+2
and over again. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43375 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20fix some breakage from the CLI command changesrussell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43372 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-11/+20
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21various cleanups, including ...russell1-120/+112
- Create an astmm_log() macro that logs the same message to both stderr as well as the mmlog file if it is open instead of duplicating the code everywhere. - Use for loops for list traversals instead of while loops - reduce nesting - ensure locking isn't put around more than is necessary - localize a struct definition - change the limit of the path to the mmlog to PATH_MAX instead of 80 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40780 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-0/+443
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b