From b8fbd42f0a7caa4cd9e2d50dd4e4b2101ac78acd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 2 Oct 2022 12:21:13 -0400 Subject: mark_overlays: Use the normal ITREE_FOREACH This commit basically reverts commit 5b954f8f9. The problem of nested iterations hasn't been fixed in the mean time, but since the GC can run arbitrary ELisp code (via `post-gc-hook`), running the GC from within an itree iteration is already unsafe anyway :-( * src/alloc.c (mark_overlays): Delete function. (mark_buffer): Use ITREE_FOREACH. --- src/itree.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/itree.h') diff --git a/src/itree.h b/src/itree.h index 1f019a2607e..29bc8dd1b25 100644 --- a/src/itree.h +++ b/src/itree.h @@ -105,7 +105,8 @@ void interval_tree_delete_gap (struct interval_tree *, ptrdiff_t, ptrdiff_t); - The expression T may be evaluated more than once, so make sure it is cheap a pure. - Only a single iteration can happen at a time, so make sure none of the - code within the loop can start another tree_itertion. + code within the loop can start another tree iteration, i.e. it shouldn't + be able to run ELisp code (or GC for that matter). - If you need to exit the loop early, you *have* to call `ITREE_ABORT` just before exiting (e.g. with `break` or `return`). - Non-local exits are not supported within the body of the loop, -- cgit v1.2.1