[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Slow scheme_basic_env on Win2000



At Tue, 14 May 2002 08:59:43 +0200, "Pascal Doux" wrote:
> BTW: should i keep the address of the first parameter in a static variable
> or can I leave it as is ?

If your application is Windows-specific, you can probably just pass
NULL as the first argument to scheme_set_stack_base(). The
Windows-specific GC code that finds the stack base seems reliable.

Otherwise, to be safe, you actually should put all Scheme work in a
procedure that is called after scheme_set_stack_base():

 void go() {
   unsigned long toto;
   scheme_set_stack_base(&toto, 1);

   really_go();
 }

 void really_go() {
   // Create a scheme session
   m_schemeEnv = scheme_basic_env();

   doTheWork(m_schemeEnv);
 }

Without the extra procedure (and its associated stack frame), some
pointers on the stack might be missed by the collector.

Matthew