mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Hold only a const version of Settings in Process
This commit is contained in:

committed by
cgzones

parent
7109172431
commit
4eb443926f
@ -69,11 +69,11 @@ ProcessPidColumn Process_pidColumns[] = {
|
||||
{ .id = 0, .label = NULL },
|
||||
};
|
||||
|
||||
DragonFlyBSDProcess* DragonFlyBSDProcess_new(Settings* settings) {
|
||||
Process* DragonFlyBSDProcess_new(const Settings* settings) {
|
||||
DragonFlyBSDProcess* this = xCalloc(1, sizeof(DragonFlyBSDProcess));
|
||||
Object_setClass(this, Class(DragonFlyBSDProcess));
|
||||
Process_init(&this->super, settings);
|
||||
return this;
|
||||
return &this->super;
|
||||
}
|
||||
|
||||
void Process_delete(Object* cast) {
|
||||
|
@ -33,7 +33,7 @@ extern ProcessFieldData Process_fields[];
|
||||
|
||||
extern ProcessPidColumn Process_pidColumns[];
|
||||
|
||||
DragonFlyBSDProcess* DragonFlyBSDProcess_new(Settings* settings);
|
||||
Process* DragonFlyBSDProcess_new(const Settings* settings);
|
||||
|
||||
void Process_delete(Object* cast);
|
||||
|
||||
|
@ -385,7 +385,7 @@ void ProcessList_goThroughEntries(ProcessList* this, bool pauseProcessUpdate) {
|
||||
bool ATTR_UNUSED isIdleProcess = false;
|
||||
|
||||
// note: dragonflybsd kernel processes all have the same pid, so we misuse the kernel thread address to give them a unique identifier
|
||||
Process* proc = ProcessList_getProcess(this, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, (Process_New) DragonFlyBSDProcess_new);
|
||||
Process* proc = ProcessList_getProcess(this, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, DragonFlyBSDProcess_new);
|
||||
DragonFlyBSDProcess* dfp = (DragonFlyBSDProcess*) proc;
|
||||
|
||||
proc->show = ! ((hideKernelThreads && Process_isKernelThread(dfp)) || (hideUserlandThreads && Process_isUserlandThread(proc)));
|
||||
|
Reference in New Issue
Block a user