From 0bdade1b6cb40c5bd374a93ac0489058a7421bb5 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 2 May 2023 09:02:22 +1000 Subject: 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. --- Affinity.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Affinity.h') diff --git a/Affinity.h b/Affinity.h index 5e7bfe2e..58d9bd73 100644 --- a/Affinity.h +++ b/Affinity.h @@ -3,14 +3,14 @@ /* htop - Affinity.h (C) 2004-2011 Hisham H. Muhammad -(C) 2020 Red Hat, Inc. All Rights Reserved. +(C) 2020,2023 Red Hat, Inc. All Rights Reserved. Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ #include "config.h" // IWYU pragma: keep -#include "ProcessList.h" +#include "Machine.h" #if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY) #include @@ -26,13 +26,13 @@ in the source distribution for its full text. typedef struct Affinity_ { - ProcessList* pl; + Machine* host; unsigned int size; unsigned int used; unsigned int* cpus; } Affinity; -Affinity* Affinity_new(ProcessList* pl); +Affinity* Affinity_new(Machine* host); void Affinity_delete(Affinity* this); @@ -40,7 +40,7 @@ void Affinity_add(Affinity* this, unsigned int id); #if defined(HAVE_LIBHWLOC) || defined(HAVE_AFFINITY) -Affinity* Affinity_get(const Process* proc, ProcessList* pl); +Affinity* Affinity_get(const Process* proc, Machine* host); bool Affinity_set(Process* proc, Arg arg); -- cgit v1.2.3