From 3cb60424e97b8fe00bb9f428e9fbffbc83f10579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Wed, 29 Oct 1997 03:23:25 -0800 Subject: [PATCH] more debug added Rev: src/object.c:1.28 --- src/object.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/object.c b/src/object.c index 6c24f45ed6..b194772b14 100644 --- a/src/object.c +++ b/src/object.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: object.c,v 1.27 1997/10/17 02:31:40 hubbe Exp $"); +RCSID("$Id: object.c,v 1.28 1997/10/29 11:23:25 hubbe Exp $"); #include "object.h" #include "dynamic_buffer.h" #include "interpret.h" @@ -256,6 +256,10 @@ void destruct_objects_to_destruct(void) while((o=objects_to_destruct)) { +#ifdef DEBUG + if(o->refs) + fatal("Object to be destructed grew extra references.\n"); +#endif /* Link object back to list of objects */ objects_to_destruct=o->next; @@ -648,6 +652,11 @@ void verify_all_objects(void) fp = frame.parent_frame; } } + + for(o=objects_to_destruct;o;o=o->next) + if(o->refs) + fatal("Object to be destructed has references.\n"); + } #endif @@ -832,6 +841,7 @@ void gc_mark_object_as_referenced(struct object *o) void gc_check_all_objects(void) { struct object *o; + for(o=first_object;o;o=o->next) { if(o->prog) @@ -845,9 +855,9 @@ void gc_check_all_objects(void) for(d=0;d<in.prog->num_identifiers;d++) { struct identifier *i=in.prog->identifiers+d; - + if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags)) continue; - + if(i->run_time_type == T_MIXED) { debug_gc_check_svalues((struct svalue *)(base+i->func.offset),1, T_OBJECT, o); -- GitLab