[asterisk-dev] [Code Review] 2903: Update vector API to be more flexible.

svnbot reviewboard at asterisk.org
Fri Nov 1 23:05:26 CDT 2013

This is an automatically generated e-mail. To reply, visit:

(Updated Nov. 1, 2013, 11:05 p.m.)


This change has been marked as submitted.

Review request for Asterisk Developers.


Committed in revision 402429

Repository: Asterisk


Made the vector macro API be more like linked lists.
1) Added a name parameter to ast_vector() to name the vector struct.
2) Made the API take a pointer to the vector struct instead of the struct itself.
3) Added an element cleanup macro/function parameter when removing an element from the vector for ast_vector_remove_cmp_unordered() and ast_vector_remove_elem_unordered().
4) Added ast_vector_get_addr() in the case the vector element is not a simple pointer.

I did not change the vector API macros to all uppercase to indicate that they are macros though it should be done.

* Converted an inline vector usage in stasis_message_router to use the vector API.  It needed the API improvements so it could be converted.

* Fixed topic reference leak in router_dtor() when the stasis_message_router is destroyed.

* Fixed deadlock potential in stasis_forward_all() and stasis_forward_cancel().  Locking two topics at the same time requires deadlock avoidance.

* Made internal_stasis_subscribe() tolerant of a NULL topic.

* Made stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_remove(), and stasis_message_router_remove_cache_update() tolerant of a NULL message_type.

* Promoted a LOG_DEBUG message to LOG_ERROR as intended in dispatch_message().


  /branches/12/main/stasis_message_router.c 401432 
  /branches/12/main/stasis.c 401432 
  /branches/12/include/asterisk/vector.h 401432 
  /branches/12/include/asterisk/lock.h 401432 

Diff: https://reviewboard.asterisk.org/r/2903/diff/


The stasis unit tests still pass.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131102/efe4385d/attachment.html>

More information about the asterisk-dev mailing list