2000-04-19
2000-04-19 21:25:33 by Martin Stjernholm <mast@lysator.liu.se>
-
87c7f91f1df5c9c0af768915e1b48a70f0685025
(23 lines)
(+17/-6)
[
Show
| Annotate
]
Branch: 7.9
More debug and a gc fix.
Rev: src/gc.c:1.72
Rev: src/gc.h:1.36
Rev: src/object.c:1.114
Rev: src/object.h:1.42
29:
#include "block_alloc.h"
- RCSID("$Id: gc.c,v 1.71 2000/04/19 18:06:45 mast Exp $");
+ RCSID("$Id: gc.c,v 1.72 2000/04/19 21:25:33 mast Exp $");
/* Run garbage collect approximate every time we have
* 20 percent of all arrays, objects and programs is
151:
if(!location) return;
/* fprintf(stderr,"**Location of (short) svalue: %p\n",location); */
- if(real_type!=-1) real_memblock=memblock;
+ if(real_type!=-1) memblock=real_memblock;
#ifdef DEBUG_MALLOC
if(memblock == 0 || type == -1)
506:
} else
#endif /* DEBUG_MALLOC */
if (((int)a) & 3) {
- fprintf(stderr,"%*s**Location: %p Type: %s Missaligned address\n",indent,"",a,
+ fprintf(stderr,"%*s**Location: %p Type: %s Misaligned address\n",indent,"",a,
get_name_of_type(t));
} else {
fprintf(stderr,"%*s**Location: %p Type: %s Refs: %d\n",indent,"",a,
514:
*(INT32 *)a);
}
- low_describe_something(a,t,indent,depth,flags);
-
+
#ifdef DEBUG_MALLOC
if(!(flags & DESCRIBE_NO_DMALLOC))
debug_malloc_dump_references(a,indent+2,depth-1,flags);
#endif
-
+ low_describe_something(a,t,indent,depth,flags);
-
+
fprintf(stderr,"%*s*******************\n",indent,"");
d_flag=tmp;
}
597: Inside #if defined(PIKE_DEBUG)
return 0;
}
+ if (Pike_in_gc != 1)
+ fatal("gc check attempted in pass %d.\n", Pike_in_gc);
+
if(m->saved_refs != -1)
if(m->saved_refs != *(INT32 *)a) {
fprintf(stderr,"**Refs changed in gc() pass %d. Expected %ld, got %ld.\n",
807:
struct marker *m;
m=get_marker(debug_malloc_pass(a));
+ #ifdef PIKE_DEBUG
+ if (Pike_in_gc != 2)
+ fatal("gc mark attempted in pass %d.\n", Pike_in_gc);
+ #endif
+
if(m->flags & GC_REFERENCED)
{
return 0;
870:
gc_evaluator_callback=0;
}
+ remove_objects_to_destruct_callback();
+
tmp2=num_objects;
#ifdef PIKE_DEBUG