From 58b42e4cac462cf4742566d9567cc8c3ac52cf8f Mon Sep 17 00:00:00 2001 From: Denis Lisov Date: Thu, 16 Dec 2021 19:09:03 +0300 Subject: ProcessList: introduce displayList Separate `processes` (the vector owning the processes, sorted in whatever order is needed right now internally) and `displayList` (a vector referencing the processes in the same order they're to be displayed). --- ProcessList.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ProcessList.h') diff --git a/ProcessList.h b/ProcessList.h index 23203928..e438421f 100644 --- a/ProcessList.h +++ b/ProcessList.h @@ -43,9 +43,9 @@ typedef unsigned long long int memory_t; typedef struct ProcessList_ { const Settings* settings; - Vector* processes; - Vector* processes2; - Hashtable* processTable; + Vector* processes; /* all known processes; sort order can vary and differ from display order */ + Vector* displayList; /* process tree flattened in display order (borrowed) */ + Hashtable* processTable; /* fast known process lookup by PID */ UsersTable* usersTable; Hashtable* displayTreeSet; @@ -109,7 +109,7 @@ void ProcessList_add(ProcessList* this, Process* p); void ProcessList_remove(ProcessList* this, const Process* p); -void ProcessList_sort(ProcessList* this); +void ProcessList_updateDisplayList(ProcessList* this); ProcessField ProcessList_keyAt(const ProcessList* this, int at); -- cgit v1.2.3