diff options
author | Nathan Scott <nathans@redhat.com> | 2023-05-02 09:02:22 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-05-08 13:06:07 +1000 |
commit | 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 (patch) | |
tree | 0e0225f7dbf6867402c5ed3481a705d01941f42e /linux/LinuxProcess.c | |
parent | e4ebe18b67c366d367231a1123b057c82018cf5b (diff) |
Introduce Machine class for host-specific info (split from ProcessList)
First stage in sanitizing the process list structure so that htop
can support other types of lists too (cgroups, filesystems, ...),
in the not-too-distant future.
This introduces struct Machine for system-wide information while
keeping process-list information in ProcessList (now much less).
Next step is to propogate this separation into each platform, to
match these core changes.
Diffstat (limited to 'linux/LinuxProcess.c')
-rw-r--r-- | linux/LinuxProcess.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 8f9c3462..a3a4c821 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -106,10 +106,10 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { #endif }; -Process* LinuxProcess_new(const Settings* settings) { +Process* LinuxProcess_new(const Machine* host) { LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess)); Object_setClass(this, Class(LinuxProcess)); - Process_init(&this->super, settings); + Process_init(&this->super, host); return &this->super; } @@ -197,7 +197,7 @@ bool LinuxProcess_changeAutogroupPriorityBy(Process* this, Arg delta) { static void LinuxProcess_writeField(const Process* this, RichString* str, ProcessField field) { const LinuxProcess* lp = (const LinuxProcess*) this; - bool coloring = this->settings->highlightMegabytes; + bool coloring = this->host->settings->highlightMegabytes; char buffer[256]; buffer[255] = '\0'; int attr = CRT_colors[DEFAULT_COLOR]; size_t n = sizeof(buffer) - 1; |