unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* How does GC know what SCM objects are on the stack?
       [not found] <660410322.617602.1580279655137.ref@mail.yahoo.com>
@ 2020-01-29  6:34 ` ZHUO Qingliang (KDr2) via General Guile related discussions
  2020-01-29  7:55   ` ZHUO Qingliang (KDr2) via General Guile related discussions
  0 siblings, 1 reply; 2+ messages in thread
From: ZHUO Qingliang (KDr2) via General Guile related discussions @ 2020-01-29  6:34 UTC (permalink / raw)
  To: Guile User


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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How does GC know what SCM objects are on the stack?
  2020-01-29  6:34 ` How does GC know what SCM objects are on the stack? ZHUO Qingliang (KDr2) via General Guile related discussions
@ 2020-01-29  7:55   ` ZHUO Qingliang (KDr2) via General Guile related discussions
  0 siblings, 0 replies; 2+ messages in thread
From: ZHUO Qingliang (KDr2) via General Guile related discussions @ 2020-01-29  7:55 UTC (permalink / raw)
  To: Guile User

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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-29  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <660410322.617602.1580279655137.ref@mail.yahoo.com>
2020-01-29  6:34 ` How does GC know what SCM objects are on the stack? ZHUO Qingliang (KDr2) via General Guile related discussions
2020-01-29  7:55   ` ZHUO Qingliang (KDr2) via General Guile related discussions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).