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 981026, Tel wrote:
> >  > Of course, the Boehm code needs to find the _absolute_ top of the
> >  > stack when possible, while Guile can get away with anything closer
> >  > to the stack bottom than main()'s frame pointer is.
> > 
> > Why is this?
> 
> Paranoia is the only reason.
> 
...
> 
> In my humble opinion, guile should attempt to scan as LITTLE of the
> stack as possible rather than as MUCH as possible. 

Right, but the Boehm case is quite a bit different from the guile case.

Consider setenv(); it has to allocate memory for the new variable string, may
have to allocate memory for a larger env vector, and chans it all together.
The root of the tree is environ, and is, from what I understand, traditionally
at the top of the stack, along with argv.  You don't want the Boehm GC
deallocating the memory for your current environment, but the only way it can
see it's in use is by scanning starting from the very top of the stack.