diff options
| author | Stefan Monnier | 2022-10-02 12:21:13 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-10-02 12:21:13 -0400 |
| commit | b8fbd42f0a7caa4cd9e2d50dd4e4b2101ac78acd (patch) | |
| tree | 25be12b466304f493f3f49857f8b26a7d85f2f7a /src/alloc.c | |
| parent | ba5fe8e7895a2cbfd2d666ca88c0ed96a73fbe29 (diff) | |
| download | emacs-b8fbd42f0a7caa4cd9e2d50dd4e4b2101ac78acd.tar.gz emacs-b8fbd42f0a7caa4cd9e2d50dd4e4b2101ac78acd.zip | |
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.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/alloc.c b/src/alloc.c index db8f39a60e0..50968b7e121 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -6512,21 +6512,6 @@ mark_overlay (struct Lisp_Overlay *ov) | |||
| 6512 | mark_object (ov->plist); | 6512 | mark_object (ov->plist); |
| 6513 | } | 6513 | } |
| 6514 | 6514 | ||
| 6515 | static void | ||
| 6516 | mark_overlays (struct interval_tree *it, struct interval_node *in) | ||
| 6517 | { | ||
| 6518 | /* `left/right` are set to NULL when the overlay is deleted, but | ||
| 6519 | they use the `null` node instead when the overlay is not deleted | ||
| 6520 | (i.e. is within an overlay tree). */ | ||
| 6521 | eassert (in); | ||
| 6522 | if (in == ITREE_NULL) | ||
| 6523 | return; | ||
| 6524 | |||
| 6525 | mark_object (in->data); | ||
| 6526 | mark_overlays (it, in->left); | ||
| 6527 | mark_overlays (it, in->right); | ||
| 6528 | } | ||
| 6529 | |||
| 6530 | /* Mark Lisp_Objects and special pointers in BUFFER. */ | 6515 | /* Mark Lisp_Objects and special pointers in BUFFER. */ |
| 6531 | 6516 | ||
| 6532 | static void | 6517 | static void |
| @@ -6548,8 +6533,9 @@ mark_buffer (struct buffer *buffer) | |||
| 6548 | if (!BUFFER_LIVE_P (buffer)) | 6533 | if (!BUFFER_LIVE_P (buffer)) |
| 6549 | mark_object (BVAR (buffer, undo_list)); | 6534 | mark_object (BVAR (buffer, undo_list)); |
| 6550 | 6535 | ||
| 6551 | if (buffer->overlays) | 6536 | struct interval_node *node; |
| 6552 | mark_overlays (buffer->overlays, buffer->overlays->root); | 6537 | ITREE_FOREACH (node, buffer->overlays, PTRDIFF_MIN, PTRDIFF_MAX, ASCENDING) |
| 6538 | mark_object (node->data); | ||
| 6553 | 6539 | ||
| 6554 | /* If this is an indirect buffer, mark its base buffer. */ | 6540 | /* If this is an indirect buffer, mark its base buffer. */ |
| 6555 | if (buffer->base_buffer && | 6541 | if (buffer->base_buffer && |