12 mars 2024 kl. 11.58 skrev Herman, Géza
<geza.herman@gmail.com>:
You can't test that code is GC-safe, you have to show that
it's correct by design.
Sure, but there has to be an explanation why the current way
doesn't have any problems.
It doesn't matter -- we don't need to prove to you why you don't
get a segfault, it's you who need to convince us that your code
is fine.
Most C code does not need any special attention as long as it
only
places Lisp roots in local variables, ie, on the C stack and in
registers. Your code keeps live roots in heap-allocated
memory. It's
not alone in doing that, but elsewhere we give those roots
special
attention, either by explicit GC marking or disabling GC during
the
lifespan of those roots.
As I said your code is probably safe unless it signals an error.