[Asterisk-code-review] loader: Replace priority heap with vector. (asterisk[master])
Richard Mudgett
asteriskteam at digium.com
Thu Dec 14 19:41:41 CST 2017
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7520 )
Change subject: loader: Replace priority heap with vector.
......................................................................
Patch Set 2: Code-Review-1
(4 comments)
https://gerrit.asterisk.org/#/c/7520/2/main/loader.c
File main/loader.c:
https://gerrit.asterisk.org/#/c/7520/2/main/loader.c@154
PS2, Line 154: * Returns comparison values for a min-heap
min-heap? We're sorting a vector.
https://gerrit.asterisk.org/#/c/7520/2/main/loader.c@586
PS2, Line 586: static struct ast_module *load_dynamic_module(const char *resource_in, unsigned int global_symbols_only, unsigned int suppress_logging, struct module_vector *resource_heap)
resource_heap is an unused parameter.
https://gerrit.asterisk.org/#/c/7520/2/main/loader.c@1194
PS2, Line 1194: AST_VECTOR_ADD_SORTED(resource_heap, mod, module_vector_cmp);
This can fail if the vector has to resize.
The previous ast_heap_push() could have failed too for the same reason.
https://gerrit.asterisk.org/#/c/7520/2/main/loader.c@1265
PS2, Line 1265: AST_VECTOR_INIT(&resource_heap, 10);
This can fail.
Would we not want to assume an initial size of 500 so the vector is unlikely to realloc?
--
To view, visit https://gerrit.asterisk.org/7520
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia23421197f09789940510b03ebbbf3bf24d51bea
Gerrit-Change-Number: 7520
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 15 Dec 2017 01:41:41 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171214/40db27f3/attachment.html>
More information about the asterisk-code-review
mailing list