This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: mod_guile design problems
forcer writes:
> >> > - I want to make smob's for the request_rec, server_rec and
> >> > conn_rec structures. Those are actually automagically
> >> > destroyed by apache when it's done with it. I have no idea how
> >> > to handle this - mod_guile modules can of course store the
> >> > smob's wherever they like, and access them even after the real
> >> > ones have vanished. sadly, apache does *not* provide a clean
> >> > way to register "cleanup"-functions for these structures.
>
> Hmm.. Guardians can be used to guard Scheme objects from the
> Guile garbage collector. The problem is, that it's neither a
> Scheme object i want to "protect" nor is it guile's garbage
> collector that is freeing the object. :(
do you have any control over the malloc/free invocation? (are you asked
to supply methods or just structs?) if the former, grep the archives
for "lilypond", since that project had similar issues when trying to
interface C++ objects w/ smobs. i'm almost certain the solution found
there would be applicable here (and perhaps is a general solution). if
the latter (no control), you may have to rely on details w/in each
structure to see if they are valid or not. blech.
thi