This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
garbage collection and C
- To: guile@sourceware.cygnus.com
- Subject: garbage collection and C
- From: shawn <sabetts@sfu.ca>
- Date: Mon, 5 Jul 1999 18:58:27 -0700
I create a smob in guile:
(define foo (make-smob "the smob"))
So if I then have a function that grabs a smob and points to it with
some internal structure in C:
(add-to-internal-structure foo)
Now somewhere I have a pointer to the smob in C that guile (I think)
doesn't know about. So now foo gets removed and there are no other
references to that smob except a pointer in C. Then when garbage
collection rears its head, that smob and the associated data would get
freed, correct? and the pointer inside C would be a dangling pointer
then, right?
So how can I tell guile that I have a pointer the smob that it doesn't
know about and it shouldn't garbage collect it until I tell it it can?
Or something of that nature...
If you could point me at some garbage collection docs I'd be overjoyed!
--
"They call me...The Searcher!"
-- The Searcher