Branch: Tag:

2003-09-26

2003-09-26 17:38:12 by Henrik Grubbström (Grubba) <grubba@grubba.org>

gc_mark_stack_external() now knows about PIKE_FRAME_MALLOCED_LOCALS.
Also added some extra debug in the mark stack case, and a few FIXME's.

Rev: src/interpret.c:1.332

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.331 2003/09/24 00:57:58 mast Exp $ + || $Id: interpret.c,v 1.332 2003/09/26 17:38:12 grubba Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.331 2003/09/24 00:57:58 mast Exp $"); + RCSID("$Id: interpret.c,v 1.332 2003/09/26 17:38:12 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
137: Inside #if defined(PIKE_DEBUG)
   gc_mark_external (f->current_object, " in current_object in frame on stack");    gc_mark_external (f->context.prog, " in context.prog in frame on stack");    if (f->locals) { /* Check really needed? */ +  if (f->flags & PIKE_FRAME_MALLOCED_LOCALS) { +  /* FIXME: In this case the frame is an object; +  * Are we counting double? +  */ +  gc_mark_external_svalues(f->locals, f->num_locals, +  " in malloced locals"); +  } else { +  /* NOTE: stack_fp may be less than f->locals. */ +  if ((stack_p - f->locals) >= 0x10000) { +  fatal("Unreasonable locals: stack:%p locals:%p\n", +  stack_p, f->locals); +  }    gc_mark_external_svalues (f->locals, stack_p - f->locals, " on svalue stack"); -  +  /* FIXME: Is this safe if stack_p is less than f->locals? */    stack_p = f->locals;    } -  +  }    } GC_LEAVE;    if (stack != stack_p)    gc_mark_external_svalues (stack, stack_p - stack, " on svalue stack");