This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: mark functions for foreign objects?
- To: Klaus.Schilling@home.ivm.de
- Subject: Re: mark functions for foreign objects?
- From: Mikael Djurfeldt <mdj@mdj-pc.nada.kth.se>
- Date: 11 Sep 1999 00:22:37 +0200
- Cc: guile@sourceware.cygnus.com
- Cc: djurfeldt@nada.kth.se
- References: <m11PKLv-000H3wC@debian>
Klaus Schilling <Klaus.Schilling@home.ivm.de> writes:
> Is there a way to specify mark functions for goops classes defined
> on the C level, such as the fdi.c example?
No. And there won't be, at least not until we get a new record
representation.
But in next release there will be something which in most cases is
better: If you declare the type of a slot to be scm_slot_SCM, that
slot will be GC marked.
Warning: The C interface should be considered alpha code. It may
change.
> Are referenced slots automatically protected from garbage collection
> when the referencing object is, such as the struct b pointer member
> in struct a in fdi.c ?
Yes. When you reference a C pointer from object A to object B, the
connection between these objects will be recorded and A won't be GC'd
until B is. (There are many things which could be discussed about
this behaviour.)