pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:1:   /*   || 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"      struct callback *gc_evaluator_callback=0;      #include "array.h"   #include "multiset.h"   #include "mapping.h"   #include "object.h"
pike.git/src/gc.c:1135: Inside #if defined(PIKE_DEBUG)
   fprintf(stderr,"%*s**The object is destructed but program found from id.\n",    indent,"");    else    fprintf(stderr,"%*s**The object is destructed and program not found from id.\n",    indent,"");    }       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++) {    struct inherit *inh = p->inherits + inh_idx;    struct program *p2 = inh->prog;       if (inh->inherit_level) {    if (inh->name) {    fprintf (stderr, "%*s**%*s=== In inherit ",    indent, "", inh->inherit_level + 1, "");    safe_print_short_svalue (stderr, (union anything *) &inh->name,    T_STRING);    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: ",    indent, "", inh->inherit_level + 1, "",    get_name_of_type (id->run_time_type));       if (id->name->size_shift)    safe_print_short_svalue (stderr, (union anything *) &id->name,    T_STRING);    else
pike.git/src/gc.c:1186: Inside #if defined(PIKE_DEBUG)
   safe_print_short_svalue_compact (stderr, (union anything *) ptr,    id->run_time_type);       fputc ('\n', stderr);    var_count++;    }    }       if (!var_count)    fprintf (stderr, "%*s** (none)\n", indent, ""); +  }       fprintf(stderr,"%*s**Describing program %p of object:\n",indent,"", p);   #ifdef DEBUG_MALLOC    if ((INT32)(ptrdiff_t) p == 0x55555555)    fprintf(stderr, "%*s**Zapped program pointer.\n", indent, "");    else   #endif    low_describe_something(p, T_PROGRAM, indent, depth,    depth ? flags : flags | DESCRIBE_SHORT, 0);   
pike.git/src/gc.c:1925: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if (gc_is_watching) {    fprintf(stderr, "## Exiting gc and resetting watches for %d things.\n",    gc_is_watching);    gc_is_watching = 0;    }   #endif   }      #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);    if (m && (m->flags & GC_CLEANUP_FREED))    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)   {    struct mapping *constants;    if (master_object)    gc_mark_external (master_object, " as master_object");    if ((constants = get_builtin_constants()))    gc_mark_external (constants, " as global constants mapping");   }
pike.git/src/gc.c:1977: Inside #if defined(PIKE_DEBUG)
      GC_ENTER (NULL, PIKE_T_UNKNOWN) {    mark_externals();    call_callback(& gc_callbacks, NULL);       gc_check_all_arrays();    gc_check_all_multisets();    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    {    extern void dmalloc_find_references_to(void *);   #if 0    fprintf(stderr,"**DMALLOC Looking for references:\n");    dmalloc_find_references_to(a);   #endif    }