Mattias Engdegård <mattias.engdegard@gmail.com> writes:
There are some options. `record_unwind_protect_ptr_mark` would
be one,
and it was made for code like this, but Gerd has been grumbling
about
it lately. Perhaps it's easier just to disable GC in the
dynamic scope
(inhibit_garbage_collection).
Yes, I'm grumbling because record_..._mark assumes GC is
mark-sweep. And
it's really super ugly to work around.
And if you disable GC, I'll be grumbling because that's not good
for a
concurrent GC.
What do I propose: If you can, please make objects reachable
from the
control stack. For instance, create a context object on the
stack that
has a Lisp vector member. That will prevent GC'ing the vector
and by
that its contents, of course. You could pass a pointer to the
context
around to get access to the vector in subroutines, replace it
with a
larger vector if necessary, and so on.