[plt-scheme] Xcode sample app

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Mar 1 10:01:28 EST 2005

At Thu, 24 Feb 2005 15:03:17 -0800, Michael Larson wrote:
> Is there a sample OS X application that is linked to mzscheme? I built 
> the latest CVS and release builds but I am getting crashes just 
> creating a scheme env. [...]
> int main(int argc, char *argv[])
> {
>          Scheme_Env              *e = scheme_basic_env(); 
> <-------------------crashes in here

I think that MzScheme works with OS X only when scheme_set_stack_base()
is called with a non-zero second argument. I've never sorted this out
properly, but because MzScheme disables the Boehm GC's handling of
dynamic libraries, I think the GC also can't find static variables in
MzScheme code.

Calling scheme_set_stack_base() with a non-zero second argument obliges
the embedding application to register static variables that can contain
GCable pointers; use the scheme_set_stack_base() function or the
MZ_REGISTER_STATIC() macro. In my experience, explicitly registering
statics is better and more reliable than having the GC try to find
them. But if this is not practical for your application, we can
investigate more.

Matthew



Posted on the users mailing list.