[sr-dev] [kamailio] rtpengine: hash table to keep the selected nodes (#390)
Richard Fuchs
notifications at github.com
Thu Dec 10 08:17:43 CET 2015
> + LM_DBG("rtpengine_hash_table size = %d\n", hash_table_size);
> +
> + // init hashtable
> + rtpengine_hash_table = shm_malloc(sizeof(struct rtpengine_hash_table));
> + if (!rtpengine_hash_table) {
> + LM_ERR("no shm left to create rtpengine_hash_table\n");
> + return 0;
> + }
> + memset(rtpengine_hash_table, 0, sizeof(struct rtpengine_hash_table));
> + rtpengine_hash_table->size = hash_table_size;
> +
> + // init hashtable row_entry_list
> + rtpengine_hash_table->row_entry_list = shm_malloc(rtpengine_hash_table->size * sizeof(struct rtpengine_hash_entry*));
> + if (!rtpengine_hash_table->row_entry_list) {
> + LM_ERR("no shm left to create rtpengine_hash_table->row_entry_list\n");
> + rtpengine_hash_table_destroy();
A minor nitpick: These calls to _destroy() here won't ever actually do anything, because the _sanity_checks() will always fail.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/390/files#r47195509
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20151209/b4fc9a64/attachment.html>
More information about the sr-dev
mailing list