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

rmudgett reviewboard at asterisk.org
Tue Oct 22 13:02:53 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2903/
-----------------------------------------------------------

(Updated Oct. 22, 2013, 6:02 p.m.)


Review request for Asterisk Developers.


Changes
-------

Freshening the diff.


Repository: Asterisk


Description
-------

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().


Diffs (updated)
-----

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

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


Testing
-------

The stasis unit tests still pass.


Thanks,

rmudgett

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


More information about the asterisk-dev mailing list