mesa/src/util/tests
Connor Abbott e8b3006bfd util/rb_tree: Add augmented trees and interval trees
An "augmented tree" is a tree with extra data attached which flows from
the leaves to the root. An "interval tree" is a datastructure of
(potentially-overlapping) intervals where, in addition to inserting and
removing intervals, we can quickly lookup all the intervals which
overlap a given interval.

After describing red-black trees, CLRS explains how it's possible to
implement an interval tree using an augmented red-black tree where the
nodes are ordered by interval start and each node also stores the
maximum interval end for its entire subtree.

Implement the interval tree extension described by CLRS. Iterating over
all overlapping intervals is actually an exercise, so we have to solve
the exercise. The recursive solution has been re-written to use the
parent pointers to avoid needing a stack, similarly to rb_tree_first()
and rb_node_next().

For now, we only implement unsigned intervals, but the core algorithms
are all abstracted to allow other types. There's still some boilerplate,
but it's the best that can be done in C.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22071>
2023-11-02 21:03:46 +00:00
..
drirc_configdir
drirc_home
format util/meson: Getting mesa util core to be self contained 2023-08-02 03:41:24 +00:00
hash_table util/meson: Getting mesa util core to be self contained 2023-08-02 03:41:24 +00:00
perf common/utrace: Prefix all environment variables with MESA_ 2022-11-11 13:50:56 +00:00
vma util/meson: Getting mesa util core to be self contained 2023-08-02 03:41:24 +00:00
bitset_test.cpp
blob_test.cpp
cache_test.cpp util/cache_test: Add test for get/put() with disabled cache 2023-09-05 09:04:34 +00:00
dag_test.cpp
fast_idiv_by_const_test.cpp
fast_urem_by_const_test.cpp
gc_alloc_tests.cpp util/tests: add gc_alloc_size alignment tests 2023-06-08 18:15:13 +00:00
half_float_test.cpp
int_min_max.cpp
linear_test.cpp util: Avoid waste space when linear alloc'ing large sizes 2023-10-08 00:55:20 +00:00
mesa-sha1_test.cpp
os_mman_test.cpp util: Add tests for os_mman.h and util_get_process_name_may_override 2022-11-15 19:55:01 +00:00
process_test.c util/process_test: make the error variable static 2023-02-24 13:30:09 +01:00
rb_tree_test.cpp util/rb_tree: Add augmented trees and interval trees 2023-11-02 21:03:46 +00:00
register_allocate_test.cpp
roundeven_test.cpp
set_test.cpp
sparse_array_test.cpp
string_buffer_test.cpp
timespec_test.cpp
u_atomic_test.cpp
u_call_once_test.cpp
u_debug_stack_test.cpp util: Fixes -Wundef in u_debug_stack_test.cpp 2022-11-24 04:33:07 +00:00
u_debug_test.cpp util: Improve prototype of debug_get_num_option and debug_get_flags_option 2022-12-16 19:30:19 +00:00
u_printf_test.cpp
u_qsort_test.cpp util/tests: adjust for new gtest 2023-05-14 11:09:01 +00:00
vector_test.cpp
xmlconfig.cpp util/xmlconfig: drop driInjectDataDir() now that DRIRC_CONFIGDIR is always supported 2023-10-16 07:59:38 +00:00