2005-02-09
2005-02-09 16:43:35 by Martin Stjernholm <mast@lysator.liu.se>
-
09f288c04d844b45e3fd699c22042fd24519707b
(68 lines)
(+38/-30)
[
Show
| Annotate
]
Branch: 7.9
Pass a flag to lfun::destroy about the reason for the destruct.
Rev: lib/modules/Object.pmod:1.1
Rev: src/builtin_functions.c:1.587
Rev: src/gc.c:1.262
Rev: src/object.c:1.265
Rev: src/object.h:1.90
Rev: src/program.c:1.586
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: gc.c,v 1.261 2004/09/30 12:12:10 mast Exp $
+ || $Id: gc.c,v 1.262 2005/02/09 16:43:35 mast Exp $
*/
#include "global.h"
3041: Inside #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
#if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
destroy_count = 0;
#endif
+ {
+ enum object_destruct_reason reason =
+ #ifdef DO_PIKE_CLEANUP
+ gc_destruct_everything ? DESTRUCT_CLEANUP :
+ #endif
+ DESTRUCT_GC;
while (kill_list) {
struct gc_frame *next = NEXT(kill_list);
struct object *o = (struct object *) kill_list->data;
3066:
}
else fputs(", is destructed\n", stderr);
);
- destruct(o);
+ destruct_object (o, reason);
free_object(o);
gc_free_extra_ref(o);
#if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
3075:
debug_really_free_gc_frame(kill_list);
kill_list = next;
}
+ }
GC_VERBOSE_DO(fprintf(stderr, "| kill: %u objects killed, %d things really freed\n",
destroy_count, pre_kill_objs - num_objects));