mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 20:24:35 +03:00
Hold only a const version of the ProcessList in Meters
This commit is contained in:

committed by
cgzones

parent
f757810f48
commit
72103e9613
@ -24,7 +24,7 @@ static const int TasksMeter_attributes[] = {
|
||||
};
|
||||
|
||||
static void TasksMeter_updateValues(Meter* this, char* buffer, int len) {
|
||||
ProcessList* pl = this->pl;
|
||||
const ProcessList* pl = this->pl;
|
||||
this->values[0] = pl->kernelThreads;
|
||||
this->values[1] = pl->userlandThreads;
|
||||
this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads;
|
||||
@ -32,7 +32,7 @@ static void TasksMeter_updateValues(Meter* this, char* buffer, int len) {
|
||||
if (pl->totalTasks > this->total) {
|
||||
this->total = pl->totalTasks;
|
||||
}
|
||||
if (this->pl->settings->hideKernelThreads) {
|
||||
if (pl->settings->hideKernelThreads) {
|
||||
this->values[0] = 0;
|
||||
}
|
||||
xSnprintf(buffer, len, "%d/%d", (int) this->values[3], (int) this->total);
|
||||
|
Reference in New Issue
Block a user