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 /CRT.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 'CRT.c')
-rw-r--r-- | CRT.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -608,9 +608,6 @@ const char* CRT_termType; int CRT_colorScheme = 0; -long CRT_pageSize = -1; -long CRT_pageSizeKB = -1; - ATTR_NORETURN static void CRT_handleSIGTERM(int sgn) { (void) sgn; @@ -746,11 +743,6 @@ void CRT_init(const int* delay, int colorScheme, bool allowUnicode) { mousemask(BUTTON1_RELEASED, NULL); #endif - CRT_pageSize = sysconf(_SC_PAGESIZE); - if (CRT_pageSize == -1) - CRT_fatalError("Fatal error: Can not get PAGE_SIZE by sysconf(_SC_PAGESIZE)"); - CRT_pageSizeKB = CRT_pageSize / 1024; - CRT_degreeSign = initDegreeSign(); } |