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: Smob documentation


On 18 Jun 1999, Jost Boekemeier wrote:

> > This is dangerous since the compiler may be smart and realize that it
> > can throw away `memoized' after the first line..., in fact, gcc will
> > very likely throw it away.
> 
> Heaven. Yes!  But wouldn't it optimize Jim's code also?

If I remember correctly there was a discussion about garbage collection
and pointers on the stack in one of the compiler news groups some time
ago.

In the discussion it turned out that conservative gc is completely at the
mercy of the compiler:  If you have a local SCM value that points to the
heap, the compiler can, in principle, do anything with it, like adding
some offset, xoring it with something and so on.  Obviously, the compiler
has to undo this modifications as soon as you access that value, but
nothing tells you about the way the value is stored on the stack.

The problem with conservative gc is, that the stack is somehow 'volatile',
because you have other processes that can access it, other than the
current one.  Maybe a solution to this problem would be to declare all
local SCM variables volatile, but it might be overkill.

Best regards,
Dirk Herrmann


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]