diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-10-15 22:37:02 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-10-19 14:42:35 +0200 |
commit | 361877454fe56c95a995d5bdbb7eb70c21e39d62 (patch) | |
tree | 51f75a8ab66ece247dbbec3c673409028bdbec74 /darwin/DarwinProcess.c | |
parent | 0db398d4c3472071b2814505242450cd8f831501 (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/DarwinProcess.c')
-rw-r--r-- | darwin/DarwinProcess.c | 6 |
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; |