[plt-scheme] MzScheme + SDL threads - Solved

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Apr 28 16:19:42 EDT 2005

At Thu, 28 Apr 2005 13:22:33 -0700, Barry Tolnas wrote:
> After some experimenting I realized that the extra function was not
> needed (maybe I'll see why its needed when the program gets more
> complicated.) Below is a working version that simply uses the
> Scheme_Env* variable to locate the stack base.

If you later add a local variable whose value is GCable, it might end
up deeper on the stack than env. Also, depending on the function body,
there's some danger that a temporary that holds a GCable value will be
placed deeper on the stack. In either of those cases, the collector
won't see the deeper pointers.

The extra wrapper function ensures that the registered local is always
deeper on the stack than any GCable pointer.

Matthew



Posted on the users mailing list.