2008-03-29
2008-03-29 18:58:22 by Martin Stjernholm <mast@lysator.liu.se>
-
cb5501ec1f5ce53db53b2b72be2fd3bc574e820a
(92 lines)
(+47/-45)
[
Show
| Annotate
]
Branch: 7.9
Don't try to describe the variables in destructed objects.
Rev: src/gc.c:1.303
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.302 2008/03/29 16:20:15 mast Exp $
+ || $Id: gc.c,v 1.303 2008/03/29 18:58:22 mast Exp $
*/
#include "global.h"
1142: Inside #if defined(PIKE_DEBUG)
if (((struct object *) a)->refs > 0 && p) {
size_t inh_idx, var_idx, var_count = 0;
+ if (((struct object *)a)->prog) {
fprintf (stderr, "%*s**Object variables:\n", indent, "");
for (inh_idx = 0; inh_idx < p->num_inherits; inh_idx++) {
1157: Inside #if defined(PIKE_DEBUG)
fprintf (stderr, ", program %d:\n", inh->prog->id);
}
else
- fprintf (stderr, "%*s**%*s=== In nameless inherit, program %d:\n",
+ fprintf (stderr,
+ "%*s**%*s=== In nameless inherit, program %d:\n",
indent, "", inh->inherit_level + 1, "", inh->prog->id);
}
for (var_idx = 0; var_idx < p2->num_variable_index; var_idx++) {
- struct identifier *id = p2->identifiers + p2->variable_index[var_idx];
+ struct identifier *id =
+ p2->identifiers + p2->variable_index[var_idx];
void *ptr;
fprintf (stderr, "%*s**%*srtt: %-8s name: ",
1193: Inside #if defined(PIKE_DEBUG)
if (!var_count)
fprintf (stderr, "%*s** (none)\n", indent, "");
+ }
fprintf(stderr,"%*s**Describing program %p of object:\n",indent,"", p);
#ifdef DEBUG_MALLOC
1932:
}
#ifdef PIKE_DEBUG
+
PMOD_EXPORT void gc_check_zapped (void *a, TYPE_T type, const char *file, int line)
{
struct marker *m = find_marker (a);
1939: Inside #if defined(PIKE_DEBUG)
fprintf (stderr, "Free of leaked %s %p from %s:%d, %d refs remaining\n",
get_name_of_type (type), a, file, line, *(INT32 *)a - 1);
}
- #endif
+
- #ifdef PIKE_DEBUG
+
/* This function marks some known externals. The rest are handled by
* callbacks added with add_gc_callback. */
static void mark_externals (void)
1984: Inside #if defined(PIKE_DEBUG)
gc_check_all_mappings();
gc_check_all_programs();
gc_check_all_objects();
- #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
+
debug_gc_check_all_types();
- #endif
+
} GC_LEAVE;
#ifdef DEBUG_MALLOC