Subject: bug#54698: non-recursive GC marking [PATCH]

From: Po Lu <[email-masked]>
Date: Tue, 05 Apr 2022 09:15:09 +0800

Mattias Engdegård <[email-masked]> writes:

> No, the mark stack grows as needed. I see no reason to limit the size
> since it's going to be much smaller than the size of the heap being
> traced in any case.

What happens if it runs out of memory?

The incremental GC I'm working on also has a similar stack for objects
that have not been marked yet, and it also grows dynamically.

If growing the stack fails, it aborts garbage collection and tells the
user to type C-x s and exit Emacs.  Objects are left with mark bits, but
that is the case when Lisp code is allowed to run "between" parts of
garbage collection anyway, and I hopefully did a good enough job fixing
the code that assumed objects cannot have mark bits during regular Lisp
execution.