dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

30 Commits

Author SHA1 Message Date
tilghman c208610d90 Two more minor fixes due to constification
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196272 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 16:53:41 +00:00
eliel 6e243a5434 Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161218 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05 10:31:25 +00:00
mmichelson 88ec29a481 If malloc returns NULL, we need to return NULL immediately or
else Asterisk will crash when attempting to dereference the NULL
pointer

(closes issue #13858)
Reported by: eliel
Patches:
      astmm.c.patch uploaded by eliel (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@157632 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-19 00:59:48 +00:00
kpfleming db07a1f968 Merged revisions 144924-144925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines
  
  improve header inclusion process in a few small ways:
  
    - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
    - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
    - simplify the usage of some of these headers in the AEL-related stuff in the utils directory
........
  r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines
  
  fix some minor issues with rev 144924
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@144949 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27 15:52:56 +00:00
mmichelson 705105e678 If attempting to free a NULL pointer when MALLOC_DEBUG
is set, don't bother searching for a region to free, just
immediately exit.

This has the dual benefit of suppressing a warning message
about freeing memory at (nil) and of optimizing the free()
replacement by not having to do any futile searching for
the proper region to free.

(closes issue #13498)
Reported by: pj
Patches:
      13498.patch uploaded by putnopvut (license 60)
Tested by: pj



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@143400 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-17 20:25:40 +00:00
kpfleming 89fb9f202a Merged revisions 129966 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r129966 | kpfleming | 2008-07-11 09:03:52 -0500 (Fri, 11 Jul 2008) | 5 lines

fix a flaw found while experimenting with structure alignment and padding; 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 :-)


........
r129967 | kpfleming | 2008-07-11 09:03:52 -0500 (Fri, 11 Jul 2008) | 5 lines

simplify calculation

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129968 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11 14:16:15 +00:00
mmichelson 8ceb053cff Get rid of any remaining ast_verbose calls in the code in favor of
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102525 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-05 23:00:15 +00:00
jamesgolovich 666fd4c462 Increase the size of filenames stored when astmm is used. If the path
length was long they would be truncated and grouped together with 
whatever matches



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100224 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-24 18:35:04 +00:00
rizzo 659205253c remove unnecessary (char *) casts for ast_config_AST_* variables.
There are some left in the .flex files, left to the maintainer...



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93582 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 09:46:18 +00:00
rizzo de2db05332 remove a bunch of useless #include "options.h"
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 23:09:02 +00:00
rizzo 4b0514e37c add missing paths.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89476 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 01:35:30 +00:00
rizzo 0cc47e4221 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89425 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19 19:09:03 +00:00
rizzo 883346d64a Start untangling header inclusion in a way that does not affect
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-11-16 20:04:58 +00:00
russell 06d06cb846 Fix another CLI command so it doesn't run the real code when called for initialization.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89076 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-07 00:16:03 +00:00
russell b8fd607d04 Fix the memory show allocations CLI command so that it doesn't spew out all
of the current memory allocations when you start Asterisk, when the command's
handler gets called for initialization.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89052 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06 19:51:37 +00:00
russell 2e0817f0ef Merged revisions 87373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87373 | russell | 2007-10-29 14:21:06 -0500 (Mon, 29 Oct 2007) | 5 lines

Remove a lock that doesn't make any sense.  The regions lock needs to be held
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/trunk@87392 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29 19:47:52 +00:00
qwell 7756b987a0 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22 20:05:18 +00:00
tilghman 8451f11052 Merged revisions 86787 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r86787 | tilghman | 2007-10-22 12:38:13 -0500 (Mon, 22 Oct 2007) | 2 lines

Minor FreeBSD build fix

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86790 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22 17:40:29 +00:00
qwell d542122e6a Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19 18:29:40 +00:00
qwell e05724ff65 More NEW_CLI conversions.
(issue #10724)
Patches:
      app_playback.c.patch uploaded by moy (license 222)
      app_minivm.c.patch uploaded by eliel (license 64)
      astmm.c.patch uploaded by eliel (license 64)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83381 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-20 23:14:30 +00:00
russell 62b554cc89 Merged revisions 78095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78095 | russell | 2007-08-03 14:39:49 -0500 (Fri, 03 Aug 2007) | 28 lines

Add some improvements to lock debugging.  These changes take effect
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/trunk@78096 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-03 19:41:42 +00:00
file bc7d45f56c Merged revisions 50820 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r50820 | file | 2007-01-14 16:59:05 -0500 (Sun, 14 Jan 2007) | 2 lines

Add missing newlines for two memory CLI commands.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@50821 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-14 22:00:51 +00:00
kpfleming c66dcd0bc5 Merged revisions 48987 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48987 | kpfleming | 2006-12-27 12:29:13 -0600 (Wed, 27 Dec 2006) | 2 lines

allow 'show memory' and 'show memory summary' to distinguish memory allocations that were done for caching purposes, so they don't look like memory leaks

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48989 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27 18:33:44 +00:00
tilghman 33d8fe4c3e Remove deprecated CLI apps from the core
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43449 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-21 21:17:39 +00:00
russell d29e6d39e5 Merged revisions 43383 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43383 | russell | 2006-09-20 18:13:16 -0400 (Wed, 20 Sep 2006) | 2 lines

Fix the total allocation count and total byte count in the memory summary

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43384 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20 22:14:04 +00:00
russell 143bcbff32 Fix the memory summary so that it doesn't print the first file in the list over
and over again.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43375 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20 21:42:57 +00:00
russell 4f97eb1b1a fix some breakage from the CLI command changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43372 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-20 21:14:02 +00:00
kpfleming 5aacb6a82d merge qwell's CLI verbification work
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18 19:54:18 +00:00
russell ed35ef9041 various cleanups, including ...
- 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-21 19:18:09 +00:00
kpfleming 8b0c007ad9 merge new_loader_completion branch, including (at least):
- 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
2006-08-21 02:11:39 +00:00