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

RE: Senora GC ?



Quoting Brent Fulgham:
> >  ... as well as the address of any static variable containing
> >    GCable pointers.
> 
> Does this mean a static variable pointing to a Scheme_Object that
> you wish the GC to destroy for you at some point? 

The opposite: register a static variable pointing to a Scheme_Object
that you want the GC to *keep* for you.

> What would be
> a good example of this, something like:
> 
> static Scheme_Object* v = NULL;
> 
> ... later ...
> 
> v = scheme_make_string("Hello, World");
> 
> ... do something ...
> 
> Later we reassign v:
> 
> v = scheme_make_string("New string.");

This is a good example. Unless `v' is registered, then the "Hello,
World" string can disappear during "... do domething ...".

> On a similar thread:  What if I have some Scheme_Object's in
> my program that I wish to retain control of (in terms of when
> or if they are collected).

SGC and Boehm are the same in that they preserve objects known to be in
use. The difference is that you have to tell SGC where to find
object-using static variables.

Matthew