[plt-scheme] Re: MzScheme incremental gc on windows unstable/not working?

From: join at krakendev.com (join at krakendev.com)
Date: Mon Jul 12 23:22:33 EDT 2004

Presently I have:
... WinMain (...) {
   unsigned long something;
   scheme_set_stack_base(&something, 1);

/*
   windows setup
   scheme setup
*/

typedef int(*iFPi)(int);
    typedef int(*iFPv)(void);
    typedef struct {
        iFPi    Init;
        iFPi    Main;
        iFPi    CleanUp;
        iFPv    GetDelta;
    } CSharedFuncs;

    Scheme_Env *e = scheme_basic_env();

    char test[128];
    sprintf(test,"(load-extension \"hello.dll\")");
    Scheme_Object *v = scheme_eval_string(test, e);

    sprintf(test,"(get-global)");
    v = scheme_eval_string(test, e);

    CSharedFuncs** r = (CSharedFuncs **)v;
    *r = new CSharedFuncs;
    (*r)->Main = Display;
    (*r)->GetDelta = ReturnDelta;

/*
   var init
*/
Scheme_Object* q;
GC_enable_incremental();

And then in the render loop:
   sprintf(test,"(render)");
   q = scheme_eval_string(test, e); //where it dies with incremental

I'm not sure what's wrong/missing...

Thanks a lot for your time in any case, Matthew.

-----------------------------
Are you already using scheme_set_stack_base() with a non-zero
second argument?

If not, it's worth a try. The problem is possibly in scanning memory to
find potential GC roots.


Posted on the users mailing list.