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: gh_enter reconsidered


On 981027, Tel wrote:
> > Not quite - it's possible to put a pointer to a user-allocated string
> > in environ using putenv or setenv, for instance.
> 
> Hmmm, should the garbage collector really decide to take responsibility
> for the environment strings? I feel that's treading on the toes of system
> libraries too much.

In the Boehm case, it has to.  It GCs the whole heap; anything malloc()ed
that it can't tell is referenced is going to be freed.  For malloced items
that are currently in the environment, the environment may be the only
reference.

Yes, it's very invasive; a C garbage collector has to be.

The guile case is easier - it only has to GC SCM objects, and can expect
at least a little cooperation from the application.