[Asterisk-code-review] astobj2: Reduce memory overhead. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Sep 27 17:13:23 CDT 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/10294 )

Change subject: astobj2: Reduce memory overhead.
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.asterisk.org/#/c/10294/1/main/astobj2.c
File main/astobj2.c:

https://gerrit.asterisk.org/#/c/10294/1/main/astobj2.c@50
PS1, Line 50: struct __priv_data {
> FYI […]
Even smaller for the default build where AO2_DEBUG is not enabled.


https://gerrit.asterisk.org/#/c/10294/1/main/astobj2.c@60
PS1, Line 60: 	/*! The ao2 object option flags */
            : 	uint32_t options:2;
            : 	/*! magic number.  This is used to verify that a pointer passed in is a
            : 	 *  valid astobj2 or ao2_weak reference */
            : 	uint32_t magic:30;
> FYI […]
That means random bytes have a 1 in 500 million chance of matching the 29-bit check.  Really I think we're fine as long as magic check is at least 20-bits, so if we needed more options flags we could just take more bits from magic.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idc1baabb35ec3b3d8de463c4fa3011eaf7fcafb5
Gerrit-Change-Number: 10294
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 27 Sep 2018 22:13:23 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180927/25546bf6/attachment.html>


More information about the asterisk-code-review mailing list