1996-09-25
1996-09-25 01:39:10 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
-
b8a6e74fb64c2bc8f42a1c90be0e903556cbf679
(31 lines)
(+31/-0)
[
Show
| Annotate
]
Branch: 7.9
more debug added
Rev: src/gc.c:1.2
Rev: src/gc.h:1.3
Rev: src/svalue.c:1.3
93:
return m;
}
+ #ifdef DEBUG
+ static void *check_for =0;
+
+ static void gdb_gc_stop_here(void *a)
+ {
+ fprintf(stderr,"One ref found.\n");
+ }
+ #endif
+
void gc_check(void *a)
{
-
+ #ifdef DEBUG
+ if(check_for)
+ {
+ if(check_for == a)
+ {
+ gdb_gc_stop_here(a);
+ }
+ return;
+ }
+ #endif
getmark(a)->refs++;
}
104: Inside #if defined(DEBUG)
m=getmark(a);
#ifdef DEBUG
if(m->refs > *(INT32 *)a)
+ {
+ check_for=a;
+
+ gc_check_all_arrays();
+ gc_check_all_multisets();
+ gc_check_all_mappings();
+ gc_check_all_programs();
+ gc_check_all_objects();
+
+ check_for=0;
fatal("Ref counts are totally wrong!!!\n");
-
+ }
#endif
return m->refs < *(INT32 *)a;
}