mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
Reduce allocation size of cp_time_n and cp_time_o on FreeBSD and DragonFlyBSD
This commit is contained in:
parent
07496eafb0
commit
1284ab4835
@ -79,8 +79,8 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, H
|
||||
|
||||
size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES;
|
||||
len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len);
|
||||
dfpl->cp_time_o = xCalloc(cpus, sizeof_cp_time_array);
|
||||
dfpl->cp_time_n = xCalloc(cpus, sizeof_cp_time_array);
|
||||
dfpl->cp_time_o = xCalloc(CPUSTATES, sizeof(unsigned long));
|
||||
dfpl->cp_time_n = xCalloc(CPUSTATES, sizeof(unsigned long));
|
||||
len = sizeof_cp_time_array;
|
||||
|
||||
// fetch initial single (or average) CPU clicks from kernel
|
||||
|
@ -109,8 +109,8 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, H
|
||||
|
||||
size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES;
|
||||
len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len);
|
||||
fpl->cp_time_o = xCalloc(cpus, sizeof_cp_time_array);
|
||||
fpl->cp_time_n = xCalloc(cpus, sizeof_cp_time_array);
|
||||
fpl->cp_time_o = xCalloc(CPUSTATES, sizeof(unsigned long));
|
||||
fpl->cp_time_n = xCalloc(CPUSTATES, sizeof(unsigned long));
|
||||
len = sizeof_cp_time_array;
|
||||
|
||||
// fetch initial single (or average) CPU clicks from kernel
|
||||
|
Loading…
Reference in New Issue
Block a user