summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-08-28 13:01:13 -0700
committerPhil Davis <phil.davis@world.inf.org>2013-08-28 13:01:13 -0700
commit517fb89ed659d418fceb75823334da02d4b5d09a (patch)
treecea5ef6f9ca83752172becb829e78de6e49f0ff0 /etc
parentf6339216b7e0c0a6a39a857ddba0c9c0a7e36237 (diff)
downloadpfsense-517fb89ed659d418fceb75823334da02d4b5d09a.zip
pfsense-517fb89ed659d418fceb75823334da02d4b5d09a.tar.gz
Improve var names in get_memory
realmem is the amount of actual (real) memory installed - the size of the RAM card - e.g. 256MB physmem is the amount of memory available to FreeBSD after BIOS, video... has stolen some of realmem. The variable names currently used are not very helpful for code readability. This standardises them. No functional change here.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/util.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 38f0d02..e6e280a 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1562,14 +1562,15 @@ function set_sysctl($values) {
* get_memory()
* returns an array listing the amount of
* memory installed in the hardware
- * [0]real and [1]available
+ * [0] net memory available for the OS (FreeBSD) after some is taken by BIOS, video or whatever - e.g. 235 MBytes
+ * [1] real (actual) memory of the system, should be the size of the RAM card/s - e.g. 256 MBytes
*/
function get_memory() {
- $real = trim(`sysctl -n hw.physmem`, " \n");
- $avail = trim(`sysctl -n hw.realmem`, " \n");
+ $physmem = trim(`sysctl -n hw.physmem`, " \n");
+ $realmem = trim(`sysctl -n hw.realmem`, " \n");
/* convert from bytes to megabytes */
- return array(($real/1048576),($avail/1048576));
+ return array(($physmem/1048576),($realmem/1048576));
}
function mute_kernel_msgs() {
OpenPOWER on IntegriCloud