guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does GC know what SCM objects are on the stack?


From: ZHUO Qingliang (KDr2)
Subject: Re: How does GC know what SCM objects are on the stack?
Date: Wed, 29 Jan 2020 07:55:15 +0000 (UTC)

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 <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]