diff options
| author | Stefan Monnier | 2022-10-09 19:45:26 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-10-09 19:45:26 -0400 |
| commit | 7cbeeabc7e6271948e7bb93020c2e4e50c65f384 (patch) | |
| tree | 777b281d62878ab7cc5a12b7e3fbc8952bf95dbc /src/lisp.h | |
| parent | 4f3f7aebc957732f4fbe5c799da5367f46607680 (diff) | |
| download | emacs-7cbeeabc7e6271948e7bb93020c2e4e50c65f384.tar.gz emacs-7cbeeabc7e6271948e7bb93020c2e4e50c65f384.zip | |
Tighten up handling of `otick`
Move args between `build_overlay` and `add_buffer_overlay`,
to try and keep buffer positions together with their buffer.
Be more strict in the `otick` values passed to `interval_tree_insert`.
Move a few things around to try and reduce dependencies through `.h` files.
Fix a thinko bug in `check_tree`.
* src/alloc.c (build_overlay): Remove `begin` and `end` args.
* src/buffer.c (add_buffer_overlay): Move from `buffer.h`.
Add `begin` and `end` args.
(copy_overlays): Adjust accordingly.
(Fmake_overlay): Use BUF_BEG and BUF_Z; adjust call to `build_overlay`
and `add_buffer_overlay`.
(Fmove_overlay): Use BUF_BEG and BUF_Z; Use the new `begin` and `end`
args of `add_buffer_overlay` so we don't need to use
`interval_node_set_region` when moving to a new buffer.
(remove_buffer_overlay, set_overlay_region): Move from `buffer.h`.
* src/buffer.h (set_overlay_region, add_buffer_overlay)
(remove_buffer_overlay): Move to `buffer.c`.
(build_overlay): Move from `lisp.h`.
(maybe_alloc_buffer_overlays): Delete function (inline into its only
caller).
* src/itree.c (interval_tree_insert): Move declaration `from buffer.h`.
(check_tree): Fix initial offset in call to `recurse_check_tree`.
Remove redundant check of the `limit` value.
(interval_node_init): Remove `begin` and `end` args.
(interval_tree_insert): Mark it as static.
Assert that the new node's `otick` should already be uptodate and its
new parent as well.
(itree_insert_node): New function.
(interval_tree_insert_gap): Assert the otick of the removed+added nodes
were uptodate and mark them as uptodate again after adjusting
their positions.
(interval_tree_inherit_offset): Check that the parent is at least as
uptodate as the child.
* src/lisp.h (build_overlay): Move to `buffer.h`.
* src/itree.h (interval_node_init): Adjust accordingly.
(interval_tree_insert): Remove declaration.
(itree_insert_node): New declaration.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index 7d838afb5c9..7cd78712814 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4415,7 +4415,6 @@ extern Lisp_Object make_float (double); | |||
| 4415 | extern void display_malloc_warning (void); | 4415 | extern void display_malloc_warning (void); |
| 4416 | extern specpdl_ref inhibit_garbage_collection (void); | 4416 | extern specpdl_ref inhibit_garbage_collection (void); |
| 4417 | extern Lisp_Object build_symbol_with_pos (Lisp_Object, Lisp_Object); | 4417 | extern Lisp_Object build_symbol_with_pos (Lisp_Object, Lisp_Object); |
| 4418 | extern Lisp_Object build_overlay (ptrdiff_t, ptrdiff_t, bool, bool, Lisp_Object); | ||
| 4419 | extern void free_cons (struct Lisp_Cons *); | 4418 | extern void free_cons (struct Lisp_Cons *); |
| 4420 | extern void init_alloc_once (void); | 4419 | extern void init_alloc_once (void); |
| 4421 | extern void init_alloc (void); | 4420 | extern void init_alloc (void); |