mark_object (ov->plist);
}
-static void
-mark_overlays (struct interval_tree *it, struct interval_node *in)
-{
- /* `left/right` are set to NULL when the overlay is deleted, but
- they use the `null` node instead when the overlay is not deleted
- (i.e. is within an overlay tree). */
- eassert (in);
- if (in == ITREE_NULL)
- return;
-
- mark_object (in->data);
- mark_overlays (it, in->left);
- mark_overlays (it, in->right);
-}
-
/* Mark Lisp_Objects and special pointers in BUFFER. */
static void
if (!BUFFER_LIVE_P (buffer))
mark_object (BVAR (buffer, undo_list));
- if (buffer->overlays)
- mark_overlays (buffer->overlays, buffer->overlays->root);
+ struct interval_node *node;
+ ITREE_FOREACH (node, buffer->overlays, PTRDIFF_MIN, PTRDIFF_MAX, ASCENDING)
+ mark_object (node->data);
/* If this is an indirect buffer, mark its base buffer. */
if (buffer->base_buffer &&
- 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,