Branch: Tag:

2000-04-22

2000-04-22 13:20:40 by Martin Stjernholm <mast@lysator.liu.se>

More gc fixes; got to keep after those pesky markers. Looks like it
actually might work ok now.

Rev: src/array.c:1.64
Rev: src/gc.c:1.56
Rev: src/gc.h:1.26
Rev: src/mapping.c:1.72
Rev: src/multiset.c:1.18
Rev: src/object.c:1.104
Rev: src/program.c:1.224
Rev: src/stralloc.c:1.82
Rev: src/svalue.c:1.66

29:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.55 2000/04/19 21:59:37 mast Exp $"); + RCSID("$Id: gc.c,v 1.56 2000/04/22 13:20:39 mast Exp $");      /* Run garbage collect approximate every time we have    * 20 percent of all arrays, objects and programs is
316:    return ret;   }    + int debug_gc_check_nongarbed(void *x, TYPE_T t, void *data) + { +  int ret; +  found_in=data; +  found_in_type=t; +  ret=gc_check_nongarbed(x); +  found_in_type=T_UNKNOWN; +  found_in=0; +  return ret; + } +    void low_describe_something(void *a, int t, int dm)   {    struct program *p=(struct program *)a;
523: Inside #if defined(PIKE_DEBUG)
   }    return 0;    } +  if (m->flags & GC_NONGARBED) +  fatal("Using gc_check() and gc_check_nongarbed() on the same object.\n");   #endif    m->flags |= GC_CHECKED;       return add_ref(m);   }    -  + INT32 real_gc_check_nongarbed(void *a) + { +  struct marker *m = get_marker(a); + #ifdef PIKE_DEBUG +  if (m->flags & GC_CHECKED) +  fatal("Using gc_check_nongarbed() and gc_check() on the same object.\n"); + #endif +  if (m->flags & GC_NONGARBED) +  return 1; +  else { +  m->flags |= GC_NONGARBED; +  return 0; +  } + } +    static void init_gc(void)   {   #if 0
714:    double multiplier;       if(Pike_in_gc) return; +  +  init_gc();    Pike_in_gc=1;       /* Make sure there will be no callback to this while we're in the gc. */
746:    objects_freed += (double) num_objects;       -  init_gc(); -  +     /* First we count internal references */    gc_check_all_arrays();    gc_check_all_multisets();
779:    gc_free_all_unreferenced_objects();       exit_gc(); +  Pike_in_gc=0;       destruct_objects_to_destruct();   
811:   #else    if(d_flag > 3) ADD_GC_CALLBACK();   #endif -  Pike_in_gc=0; +    }