[Asterisk-code-review] vector: Add AST_VECTOR_COMPACT() to reclaim wasted space (...asterisk[13])

Kevin Harwell asteriskteam at digium.com
Fri Mar 15 14:04:22 CDT 2019


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11150 )

Change subject: vector: Add AST_VECTOR_COMPACT() to reclaim wasted space
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/11150/2/include/asterisk/vector.h 
File include/asterisk/vector.h:

https://gerrit.asterisk.org/#/c/11150/2/include/asterisk/vector.h@605 
PS2, Line 605: 			typeof((vec)->elems) new_elems = ast_realloc(		\
             : 				new_max * sizeof(*new_elems));
This is  missing the "ptr" parameter.


https://gerrit.asterisk.org/#/c/11150/2/include/asterisk/vector.h@607 
PS2, Line 607: 			if (new_elems) {									\
I'm not sure if it is possible when shrinking memory (never creates new memory?), but if the return memory is non NULL and differs from the original then the original needs to be free'd.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11150
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I9711daa0fe01783fc6f04c5710eba84f2676d7b9
Gerrit-Change-Number: 11150
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Fri, 15 Mar 2019 19:04:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190315/bcd97caa/attachment.html>


More information about the asterisk-code-review mailing list