oom: use CMP() macro
This commit is contained in:
parent
751b440063
commit
95ca39f04e
|
@ -64,24 +64,14 @@ static inline int compare_pgscan(OomdCGroupContext * const *c1, OomdCGroupContex
|
||||||
assert(c1);
|
assert(c1);
|
||||||
assert(c2);
|
assert(c2);
|
||||||
|
|
||||||
if ((*c1)->pgscan > (*c2)->pgscan)
|
return CMP((*c2)->pgscan, (*c1)->pgscan);
|
||||||
return -1;
|
|
||||||
else if ((*c1)->pgscan < (*c2)->pgscan)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int compare_swap_usage(OomdCGroupContext * const *c1, OomdCGroupContext * const *c2) {
|
static inline int compare_swap_usage(OomdCGroupContext * const *c1, OomdCGroupContext * const *c2) {
|
||||||
assert(c1);
|
assert(c1);
|
||||||
assert(c2);
|
assert(c2);
|
||||||
|
|
||||||
if ((*c1)->swap_usage > (*c2)->swap_usage)
|
return CMP((*c2)->swap_usage, (*c1)->swap_usage);
|
||||||
return -1;
|
|
||||||
else if ((*c1)->swap_usage < (*c2)->swap_usage)
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get an array of OomdCGroupContexts from `h`, qsorted from largest to smallest values according to `compare_func`.
|
/* Get an array of OomdCGroupContexts from `h`, qsorted from largest to smallest values according to `compare_func`.
|
||||||
|
|
Loading…
Reference in New Issue