[Asterisk-code-review] pbx.c: Include filesystem cache in free memory calculation (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Thu Jan 16 09:29:06 CST 2020


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/13597 )

Change subject: pbx.c: Include filesystem cache in free memory calculation
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/c/asterisk/+/13597/1/main/pbx.c 
File main/pbx.c:

https://gerrit.asterisk.org/c/asterisk/+/13597/1/main/pbx.c@4597 
PS1, Line 4597: 			curfreemem = (sys_info.freeram + sys_info.bufferram) * sys_info.mem_unit;
With the amount of memory available to machines these days, how likely is it that this calculation will have overflow problems?  Since a long is going to have 32 bits you cannot have more than 4GB of memory without overflowing.  Upping to use uint64_t and making sure that the calculation uses 64 bit math will prevent the overflow.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8
Gerrit-Change-Number: 13597
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Thu, 16 Jan 2020 15:29:06 +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/20200116/04685817/attachment.html>


More information about the asterisk-code-review mailing list