This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: mark functions for foreign objects?


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.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]