guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Controlling the garbage collector?


From: Bobby D. Bryant
Subject: Controlling the garbage collector?
Date: Sat, 17 Mar 2001 19:22:28 +0600

Is it possible to disable, or at least restrain, guile's garbage
collector?  I'm being eaten alive by this message:

ERROR: In procedure apply:
ERROR: Wrong type argument in position 1: #<freed cell 0x40878878; GC
missed a reference>

My host program loads and evaluates a lambda expression to create a
Scheme function, and stores the resulting SCM in a program variable.
The program invokes the Scheme function once each time GTK+ causes a
certain host program procedure to execute, and that is where the problem
occurs.

Invariably, the SCM variable is corrupt the very first time the host
program's procedure executes.  However, I can catch that by asking guile
whether the variable is a Scheme procedure and then reloading the
definition from the external file if it is not.  Then everything runs
fine... for a while.  How long it runs is random, but never more than a
minute or so.  My best guess is that eventually the garbage collector
eats the Scheme function during the short time period between the check
to ensure that it is indeed a function and the actual application of the
function.

I suspect I am trying to use guile outside the realm it was designed for
(Ada, GTK+), but perhaps there's some trick that will help me out.  Is
there a mechanism for temporarily suspending garbage collection?  Or is
it possible to set up data spaces that are exempt from examination by
the garbage collector?

Thanks,

Bobby Bryant
Austin, Texas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]