diff options
author | Nathan Scott <nathans@redhat.com> | 2020-12-10 11:57:48 +1100 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-12-10 11:57:48 +1100 |
commit | 75e9f9a8d92cda6ae8b161f1bf662597ac67c0f2 (patch) | |
tree | 397da395644c86f292d26bfe9226cfb5084c9735 /Process.c | |
parent | db5687a3556385521c42ee729aaa75a282b47c8c (diff) |
Cull the definitions of pageSize and pageSizeKB from CRT.c
By storing the per-process m_resident and m_virt values in the form
htop wants to display them in (KB, not pages), we no longer need to
have definitions of pageSize and pageSizeKB in the common CRT code.
These variables were never really CRT (i.e. display) related in the
first place. It turns out the darwin platform code doesn't need to
use these at all (the process values are extracted from the kernel
in bytes not pages) and the other platforms can each use their own
local pagesize variables, in more appropriate locations.
Some platforms were actually already doing this, so this change is
removing duplication of logic and variables there.
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -328,8 +328,8 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field } case MAJFLT: Process_colorNumber(str, this->majflt, coloring); return; case MINFLT: Process_colorNumber(str, this->minflt, coloring); return; - case M_RESIDENT: Process_humanNumber(str, this->m_resident * CRT_pageSizeKB, coloring); return; - case M_VIRT: Process_humanNumber(str, this->m_virt * CRT_pageSizeKB, coloring); return; + case M_RESIDENT: Process_humanNumber(str, this->m_resident, coloring); return; + case M_VIRT: Process_humanNumber(str, this->m_virt, coloring); return; case NICE: { xSnprintf(buffer, n, "%3ld ", this->nice); attr = this->nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY] |