Branch: Tag:

2001-07-02

2001-07-02 00:41:16 by Martin Stjernholm <mast@lysator.liu.se>

Made parent program references strong. Misc small fixes.

Rev: src/program.c:1.342

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.341 2001/07/01 22:48:34 grubba Exp $"); + RCSID("$Id: program.c,v 1.342 2001/07/02 00:41:16 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
4425:      static void gc_recurse_frame(struct pike_frame *f)   { -  if(!f) return; +     if(f->current_object) gc_recurse_object(f->current_object);    if(f->context.prog) gc_recurse_program(f->context.prog);    if(f->context.parent) gc_recurse_object(f->context.parent);
4436:      static void gc_recurse_trampoline(struct object *o)   { -  gc_recurse_frame(THIS->frame); +  if (THIS->frame) gc_recurse_frame(THIS->frame);   }      
4598: Inside #if defined(GC2)
      if (!(p->flags & PROGRAM_AVOID_CHECK))    { -  if(p->parent) -  gc_cycle_check_program(p->parent, 0); -  +     for(e=0;e<p->num_constants;e++)    gc_cycle_check_svalues(& p->constants[e].sval, 1);   
4612: Inside #if defined(GC2)
   if(e && p->inherits[e].prog)    gc_cycle_check_program(p->inherits[e].prog, 0);    } +  +  /* Strong ref follows. It must be last. */ +  if(p->parent) +  gc_cycle_check_program(p->parent, 0);    }    } GC_CYCLE_LEAVE;   }
4626: Inside #if defined(GC2)
   debug_malloc_touch(p);       if (p->flags & PROGRAM_AVOID_CHECK) { -  /* Program is in an inconsistant state. +  /* Program is in an inconsistent state.    * don't look closer at it.    */    debug_malloc_touch(p);
4634: Inside #if defined(GC2)
   }       if(p->parent) -  debug_gc_check2(p->parent, T_PROGRAM, p, " as parent object of a program"); +  debug_gc_check2(p->parent, T_PROGRAM, p, " as parent program of a program");       for(e=0;e<p->num_constants;e++) {    debug_gc_check_svalues(& p->constants[e].sval, 1, T_PROGRAM, p);
4655: Inside #if defined(GC2)
      if(e && p->inherits[e].prog)    debug_gc_check2(p->inherits[e].prog, T_PROGRAM, p, -  " as inherited program"); +  " as inherited program of a program");    }      #ifdef PIKE_DEBUG
4764: Inside #if defined(GC2)
   free_object(p->inherits[e].parent);    p->inherits[e].parent=0;    } +  if(e && p->inherits[e].prog) +  { +  free_program(p->inherits[e].prog); +  p->inherits[e].prog=0;    } -  +  }    -  /* FIXME: Is there anything else that needs to be freed here? */ +     gc_free_extra_ref(p);    SET_NEXT_AND_FREE(p, free_program);   #ifdef PIKE_DEBUG