Move some implementation specific code from astobj2_container.c into
astobj2_hash.c and astobj2_rbtree.c. This completely removes the need for
astobj2_container to switch on RTTI and it no longer has any knowledge of
the implementation details.
Also adds AO2_DEBUG as a new compile option in menuselect which controls
astobj2 debugging independently of AST_DEVMODE and REF_DEBUG.
Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3593/
........
Merged revisions 416806 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch does the following:
(1) It makes REF_DEBUG a meneselect item. Enabling REF_DEBUG now enables
REF_DEBUG globally throughout Asterisk.
(2) The ref debug log file is now created in the AST_LOG_DIR directory.
Every run will now blow away the previous run (as large ref files
sometimes caused issues). We now also no longer open/close the file
on each write, instead relying on fflush to make sure data gets written
to the file (in case the ao2 call being performed is about to cause a
crash)
(3) It goes with a comma delineated format for the ref debug file. This
makes parsing much easier. This also now includes the thread ID of the
thread that caused ref change.
(4) A new python script instead for refcounting has been added in the
contrib/scripts folder.
(5) The old refcounter implementation in utils/ has been removed.
Review: https://reviewboard.asterisk.org/r/3377/
........
Merged revisions 412114 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 412115 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 412153 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].
This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.
For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.
Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)
The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.
Other changes made as a part of this patch:
* The stubs for http_websocket that wrap system calls set errno to
ENOSYS.
* res_http_websocket now properly increments module use count.
* In loader.c, the while() wrappers around dlclose() were removed. The
while(!dlclose()) is actually an anti-pattern, which can lead to
infinite loops if the module you're attempting to unload exports a
symbol that was directly linked to.
* The special handling of nonoptreq on systems without weak symbol
support was removed, since we no longer rely on weak symbols for
optional_api.
[1]: https://wiki.asterisk.org/wiki/x/wACUAQ
(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........
Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A GCC bug[1] can, in some cases, pop up an unsuppressible pedwarn when
using a static inline standard library function from a non-static
inline function.
This normally doesn't show up, but can occur if you're running an
upgrade version of GCC (such as GCC 4.8 on OS X, which normally runs
GCC 4.2).
[1]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47816
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Some core support modules and compiler options were no longer tagged with a
module support level. This patch adds 'core' back to those options.
Note that this patch modifies a few of the patches provided by Andrew Latham
slightly. res_curl and res_fax are both 'core' supported modules.
(closes issue ASTERISK-20215)
Reported by: Andrew Latham
Tested by: mjordan
Patches:
astcanary.diff (license #5985) uploaded by Andrew Latham
cflagsxml.diff (license #5985) uploaded by Andrew Latham
curl_fax.diff (license #5985) uploaded by Andrew Latham
soundsxml.diff (license #5985) uploaded by Andrew Latham
........
Merged revisions 371507 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This change builds upon the recent change to menuselect to add 'touch_on_change'
as an attribute of both categories and members. This should allow only the most
invasive defines to cause a complete rebuild, while defines which only affect a
subset of modules will only cause a rebuild of that smaller set.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There is a lot that could be said about this, but the patch is a big
improvement for performance, stability, code maintainability,
and ease of future code development.
The channel list is no longer an unsorted linked list. The main container
for channels is an astobj2 hash table. All of the code related to searching
for channels or iterating active channels has been rewritten. Let n be
the number of active channels. Iterating the channel list has gone from
O(n^2) to O(n). Searching for a channel by name went from O(n) to O(1).
Searching for a channel by extension is still O(n), but uses a new method
for doing so, which is more efficient.
The ast_channel object is now a reference counted object. The benefits
here are plentiful. Some benefits directly related to issues in the
previous code include:
1) When threads other than the channel thread owning a channel wanted
access to a channel, it had to hold the lock on it to ensure that it didn't
go away. This is no longer a requirement. Holding a reference is
sufficient.
2) There are places that now require less dealing with channel locks.
3) There are places where channel locks are held for much shorter periods
of time.
4) There are places where dealing with more than one channel at a time becomes
_MUCH_ easier. ChanSpy is a great example of this. Writing code in the
future that deals with multiple channels will be much easier.
Some additional information regarding channel locking and reference count
handling can be found in channel.h, where a new section has been added that
discusses some of the rules associated with it.
Mark Michelson also assisted with the development of this patch. He did the
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it
much easier to deal with holding on to a channel pointer for an extended period
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.
Thanks to David Vossel for his assistance with this branch, as well. David
did the conversion of the DAHDIScan application by making it become a wrapper
for ChanSpy internally.
The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.
Review: http://reviewboard.digium.com/r/203/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r109973 | qwell | 2008-03-19 12:12:52 -0500 (Wed, 19 Mar 2008) | 5 lines
People report bugs about Asterisk crashing with DO_CRASH enabled was getting a little silly...
Now we only show certain cflags when you run configure with --enable-dev-mode
(corresponding menuselect change to follow)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This does introduce a dependency on the GMime library for handling HTTP POSTs, but it is available in most distros.
If the library is present, then the compile flag for ENABLE_UPLOADS is enabled by default in menuselect.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
for Mark Spencers upcoming 30th birthday.
To enable, run `make menuselect` and select the option MARKO_BDAY under Compiler Flags.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
- 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: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
reverted per-directory .cleancount support
added ability for 'remove_on_change' to support multiple filenames
add 'remove_on_change' support to members, not just categories
only do 'remove_on_change' removals if the config is actually saved
add a 'remove_on_change' entry for each module found by prep_moduledeps so that if it gets turned off any existing .o/.so files will disappear
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
option in menuselect. This is very useful for developers if you want to ensure
that all of your builds are done without optimizations.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
instead of being added to the compiler commands. This header file will be
installed and modules built outside of the main tree will be able to use the
same build options used to build the rest of Asterisk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@26808 65c4cc65-6c06-0410-ace0-fbb531ad65f3