summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-15 22:37:02 +0200
committerChristian Göttsche <cgzones@googlemail.com>2020-10-19 14:42:35 +0200
commit361877454fe56c95a995d5bdbb7eb70c21e39d62 (patch)
tree51f75a8ab66ece247dbbec3c673409028bdbec74 /darwin
parent0db398d4c3472071b2814505242450cd8f831501 (diff)
Cache PAGE_SIZE
man:sysconf(3) states: The values obtained from these functions are system configuration constants. They do not change during the lifetime of a process.
Diffstat (limited to 'darwin')
-rw-r--r--darwin/DarwinProcess.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
index 48574e2f..7049cb1e 100644
--- a/darwin/DarwinProcess.c
+++ b/darwin/DarwinProcess.c
@@ -15,6 +15,8 @@ in the source distribution for its full text.
#include <mach/mach.h>
+#include "CRT.h"
+
const ProcessClass DarwinProcess_class = {
.super = {
@@ -257,8 +259,8 @@ void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList
proc->super.time = (pti.pti_total_system + pti.pti_total_user) / 10000000;
proc->super.nlwp = pti.pti_threadnum;
- proc->super.m_size = pti.pti_virtual_size / 1024 / PAGE_SIZE_KB;
- proc->super.m_resident = pti.pti_resident_size / 1024 / PAGE_SIZE_KB;
+ proc->super.m_size = pti.pti_virtual_size / CRT_pageSize;
+ proc->super.m_resident = pti.pti_resident_size / CRT_pageSize;
proc->super.majflt = pti.pti_faults;
proc->super.percent_mem = (double)pti.pti_resident_size * 100.0
/ (double)dpl->host_info.max_mem;

© 2014-2024 Faster IT GmbH | imprint | privacy policy