summaryrefslogtreecommitdiff
path: root/src/itree.h
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2022-11-02 03:50:38 +0200
committerBasil L. Contovounesios <contovob@tcd.ie>2022-11-03 16:49:05 +0200
commita66280162f907a09be23922cc80ac352392adac6 (patch)
tree849424a1c4025c04d16602f65410a23ae26c7d00 /src/itree.h
parent8b8038494ce8354a3e2cfffebba40dbd1328ebb9 (diff)
downloademacs-a66280162f907a09be23922cc80ac352392adac6.tar.gz
Port interval trees to --enable-checking=structs
Some names under the interval_* namespace were renamed under the itree_* namespace in commits: 0. f421b58db5 of 2022-10-19 "Prefix all itree.h type names with itree_". 1. 37a1145410 of 2022-10-19 "Rename all exported itree.h functions with the itree_ prefix" Further, some values still referenced in commentary were removed in commits: 2. 258e618364 of 2022-10-17 "Delete the itree_null sentinel node, use NULL everywhere." 3. 2c4a3910b3 of 2022-10-02 "itree: Use a single iterator object" * src/emacs.c (main): Allocate global itree iterator once and for all. * src/alloc.c (mark_overlay): * src/buffer.c (set_overlays_multibyte): * src/itree.c (itree_destroy): Update commentary. (interval_stack_ensure_space, itree_insert_gap): Prefer unsigned-to-unsigned comparisons over signed-to-unsigned. (interval_stack_push_flagged, interval_tree_insert) (interval_tree_contains, itree_iterator_start) (itree_iterator_finish, itree_iterator_next, itree_iterator_narrow): Improve assertions. (itree_init): Rename... (init_itree): ...to this, for consistency with other global init functions. (itree_create): Stop leaking a global iterator allocation on each call. (interval_tree_init): Complete renames of interval_tree -> itree_tree and interval_tree_clear -> itree_clear. (interval_tree_remove_fix): Fix indentation. * src/itree.h: Declare init_itree. (ITREE_FOREACH): Fix typo in commentary. * src/pdumper.c [CHECK_STRUCTS] (dump_interval_node): Use the correct name in the HASH condition and #error message. (dump_overlay, dump_buffer): Update HASH (bug#58975).
Diffstat (limited to 'src/itree.h')
-rw-r--r--src/itree.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/itree.h b/src/itree.h
index c6b68d36672..49a0333f345 100644
--- a/src/itree.h
+++ b/src/itree.h
@@ -106,6 +106,7 @@ enum itree_order
ITREE_PRE_ORDER,
};
+extern void init_itree (void);
extern void itree_node_init (struct itree_node *, bool, bool, Lisp_Object);
extern ptrdiff_t itree_node_begin (struct itree_tree *, struct itree_node *);
extern ptrdiff_t itree_node_end (struct itree_tree *, struct itree_node *);
@@ -147,7 +148,7 @@ extern struct itree_node *itree_iterator_next (struct itree_iterator *);
BEWARE:
- The expression T may be evaluated more than once, so make sure
- it is cheap a pure.
+ it is cheap and pure.
- Only a single iteration can happen at a time, so make sure none of the
code within the loop can start another tree iteration, i.e. it shouldn't
be able to run ELisp code, nor GC since GC can run ELisp by way