diff options
author | Matt Armstrong <matt@rfc20.org> | 2022-10-19 13:42:35 -0700 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-19 21:35:09 -0400 |
commit | 06252617b2c4cc9bcdd9407f1e709a7e0908cf27 (patch) | |
tree | 494a0f21b5f87949886c57bfba87bd4ab013f49b /src/itree.h | |
parent | 8159d8b1a71dd59e31060f00b2abe20ad9d1f924 (diff) | |
download | emacs-06252617b2c4cc9bcdd9407f1e709a7e0908cf27.tar.gz emacs-06252617b2c4cc9bcdd9407f1e709a7e0908cf27.tar.bz2 emacs-06252617b2c4cc9bcdd9407f1e709a7e0908cf27.zip |
Revert "mark_overlays: Use the normal ITREE_FOREACH"
This reverts commit b8fbd42f0a7caa4cd9e2d50dd4e4b2101ac78acd,
with edits.
* src/alloc.c (mark_overlays): restore function.
(mark_buffer): Call it, not ITREE_FOREACH.
(garbage_collect): eassert (!itree_busy_p ()).
* src/itree.h: Comment tweak: explain why GC is considered risky. It
isn't that GC itself is risky, it is that GC can call ELisp by way of
a hook, and running ELisp during iteration is risks nested iteration.
Diffstat (limited to 'src/itree.h')
-rw-r--r-- | src/itree.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/itree.h b/src/itree.h index 8d33ef223b5..b0f7a1d193b 100644 --- a/src/itree.h +++ b/src/itree.h @@ -149,7 +149,8 @@ struct interval_node *itree_iterator_next (struct itree_iterator *); 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 iteration, i.e. it shouldn't - be able to run ELisp code (or GC for that matter). + be able to run ELisp code, nor GC since GC can run ELisp by way + of `post-gc-hook`. - 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. |