From 0f4e3ebc955347e80f6d098422e79f6f6202eeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 21 Nov 2020 19:13:49 +0100 Subject: [PATCH] Simplify page size related calculations --- dragonflybsd/DragonFlyBSDProcessList.c | 2 +- freebsd/FreeBSDProcessList.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index 5d72ea48..5660d47c 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -442,7 +442,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { } } - proc->m_virt = kproc->kp_vm_map_size / 1024 / pageSizeKb; + proc->m_virt = kproc->kp_vm_map_size / pageSize; proc->m_resident = kproc->kp_vm_rssize; proc->nlwp = kproc->kp_nthreads; // number of lwp thread proc->time = (kproc->kp_swtime + 5000) / 10000; diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c index 161f64ba..2bc35251 100644 --- a/freebsd/FreeBSDProcessList.c +++ b/freebsd/FreeBSDProcessList.c @@ -543,7 +543,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { } // from FreeBSD source /src/usr.bin/top/machine.c - proc->m_virt = kproc->ki_size / 1024 / pageSizeKb; + proc->m_virt = kproc->ki_size / pageSize; proc->m_resident = kproc->ki_rssize; proc->nlwp = kproc->ki_numthreads; proc->time = (kproc->ki_runtime + 5000) / 10000;