[Mono-list] mono-0.28/libgc/misc.c:GC_clear_stack_inner comments, please

Peter Kostouros kpeter@melbpc.org.au
Sun, 26 Oct 2003 09:28:45 +1100


Hi

I wonder if I can get some input from the following snippet of code 
(mono-0.28/libgc/misc.c:GC_clear_stack_inner).  What is the essence of 
this function? Mono applications abnormally terminate upon completion: 
perhaps something going wrong with recursion?

Note target machine is FreeBSD (CURRENT), and ASM_CLEAR_CODE is false.

#if defined(ASM_CLEAR_CODE)
  extern ptr_t GC_clear_stack_inner();
#else 
/* Clear the stack up to about limit.  Return arg. */
/*ARGSUSED*/
ptr_t GC_clear_stack_inner(arg, limit)
ptr_t arg;
word limit;
{ 
    word dummy[CLEAR_SIZE];
   
    BZERO(dummy, CLEAR_SIZE*sizeof(word));
    if ((word)(dummy) COOLER_THAN limit) {
        (void) GC_clear_stack_inner(arg, limit);
    }
    /* Make sure the recursive call is not a tail call, and the bzero    */
    /* call is not recognized as dead code.                */
    GC_noop1((word)dummy);
    return(arg);
}
#endif


-- 

Regards

Peter

As always the organisation disavows knowledge of this email