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).
This commit is contained in:
Denis Lisov
2021-12-16 19:09:03 +03:00
committed by BenBE
parent 2477a5a018
commit 58b42e4cac
2 changed files with 54 additions and 61 deletions

View File

@ -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);