chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Disable garbage collection


From: Nicolas Pelletier
Subject: Re: [Chicken-users] Disable garbage collection
Date: Fri, 6 Aug 2010 08:34:46 +0900

On Fri, Aug 6, 2010 at 12:54 AM, John Cowan <address@hidden> wrote:
> I suppose you could have a startup option which disables major GCs and
> allocates one big space, and then kills the program while it runs out.

You can compile with -heap-size XXX, which will produce an executable
using a fixed amount of heap and die if it runs out of space. Running
out of heap triggers a panic in the chicken library, so you cannot
catch it as an error condition and try to act on it (and there would
be no guaranties anyway as to what you would still be able to do if
you could anyway).

>  But perhaps the question is aimed at disabling GC in a given dynamic
> scope, so as to be sure that pointers retained internally by C code
> still work.  This would have to be preceded by a minor GC, of course.

The foreign function interface allows you to define new "GC roots" to
avoid having data shared with foreign code from being garbage
collected.

Regards,

-- 
Nicolas



reply via email to

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