Oh, I got it from the doc: Instead of requiring the user to inform Guile about all variables in C that might point to heap objects, Guile traces the C stack and static data segment conservatively. That is to say, Guile just treats every word on the C stack and every C global variable as a potential reference in to the Scheme heap4. Any value that looks like a pointer to a GC-managed object is treated as such, whether it actually is a reference or not.
On Wednesday, January 29, 2020, 14:34, ZHUO Qingliang (KDr2) via General Guile related discussions <guile-user@gnu.org> wrote: I just read the docs about GC, if I understand it correctly, in a c program, all static variables, global variable, and local variables that hold SCM objects are registered to GC protection automatically. I want to know how does the GC make this, could anyone give me a clue? Many thanks.