lib: Introduce generic min-heap
Supports push, pop and converting an array into a heap. If the sense of the compare function is inverted then it can provide a max-heap. Based-on-work-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lkml.kernel.org/r/20200214075133.181299-3-irogers@google.com
This commit is contained in:
@@ -1769,6 +1769,16 @@ config TEST_LIST_SORT
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config TEST_MIN_HEAP
|
||||
tristate "Min heap test"
|
||||
depends on DEBUG_KERNEL || m
|
||||
help
|
||||
Enable this to turn on min heap function tests. This test is
|
||||
executed only once during system boot (so affects only boot time),
|
||||
or at module load time.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config TEST_SORT
|
||||
tristate "Array-based sort test"
|
||||
depends on DEBUG_KERNEL || m
|
||||
|
Reference in New Issue
Block a user