This is the mail archive of the guile@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: Guile, C, and Garbage Collection



Thanks to Maciej and Mikael for their well considered replies.

The situations I've run into this problem in the past heve been
writing guile wrappers to existing C libraries, and I didn't have a
realistic option to modify the C structures.  "up the proverbial
creek" in Maciej's words.

But I'm currently working on my own library, and I'm trying to write
it in such a way that it is not dependent on guile.  i.e.  I'm writing
a C library for use by C programmers, with an overlying Guile
interface for smarter, sexier, Guile programmers.

The work I've done so far has been on core C internals where the cross
links between data are minimal, but I'm nearing the stage where I want
to link the C strucures together, and I'm trying to select the best
design that is compatible with Guile's gc mechanism, but not dependent
on it.

With these goals in mind, it seems that ref counting is my best
option.  On reflection, I guess I would have to do that anyway.

Daniel