Erick:
We encountered and have fixed another couple of problems
with the STk garbage collector. I wanted to let you know
about them, and to solicit your advice on how best to have
a general fix for the second.
Our implementation is still based on version 3.99.4.
The first problem was that the longjmp solution for
marking the registers does not work for the x86 platform -
it misses some of the registers. The fix for this
was easy - we copy the relevant registers to local variables
in gc_mark_and_sweep, and mark them individually.
______
Paul Anderson. GrammaTech, Inc. Tel: +1 607 273-7340
mailto:paul_at_grammatech.com
http://www.grammatech.com
#ifdef PURE_WIN32
static DWORD REG_EAX;
static DWORD REG_EBX;
static DWORD REG_ECX;
static DWORD REG_EDX;
static DWORD REG_EBP;
static DWORD REG_ESI;
static DWORD REG_EDI;
static void mark_one_DWORD(DWORD* ptr){
STk_mark_stack((SCM *)ptr, (SCM *) (ptr+1));
}
#endif /* PURE_WIN32 */
static void gc_mark_and_sweep(void)
{
long prev_context = STk_err_handler->context;
SCM stack_end; /* The topmost variable (at least a SCM) allocated on stack */
/**** Disallow interrupts while GC'ing because signal handlers may cons */
STk_ignore_signals();
STk_err_handler->context = ERR_FATAL;
gc_start();
/**** Marking phase */
#ifdef PURE_WIN32
__asm mov REG_EAX, eax
__asm mov REG_EBX, ebx
__asm mov REG_ECX, ecx
__asm mov REG_EDX, edx
__asm mov REG_EBP, ebp
__asm mov REG_ESI, esi
__asm mov REG_EDI, edi
mark_one_DWORD(®_EAX);
mark_one_DWORD(®_EBX);
mark_one_DWORD(®_ECX);
mark_one_DWORD(®_EDX);
mark_one_DWORD(®_EBP);
mark_one_DWORD(®_ESI);
mark_one_DWORD(®_EDI);
#else
register_scan();
#endif /* PURE_WIN32 */
STk_mark_stack((SCM *) STk_stack_start_ptr, (SCM *) &stack_end); /* stack */
mark_protected(); /* globals */
/**** Sweep phase */
gc_sweep();
/* Re-allow signals */
gc_end();
STk_err_handler->context = prev_context;
STk_allow_signals();
/* send the pseudo-signal SIGHADGC to say that we had a finished GC'ing */
STk_signal_GC();
}
Received on Wed Apr 05 2000 - 18:19:18 CEST