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.303 2008/03/29 18:58:22 mast Exp $ + || $Id: gc.c,v 1.304 2008/03/30 01:24:09 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:1475:    }    else    fprintf(stderr, "%*s**No current object.\n", indent, "");    if ((f = f->scope))    fprintf(stderr, "%*s**Moving on to outer scope frame %p:\n", indent, "", f);    } while (f);    break;    }       default: -  fprintf(stderr, "%*s**Cannot describe block of unknown type %d\n", -  indent, "", t); +  fprintf(stderr, "%*s**Cannot describe block of type %s (%d)\n", +  indent, "", get_name_of_type (t), t);    }   }      void describe_something(void *a, int t, int indent, int depth, int flags,    void *inblock)   {    int tmp;    struct program *p=(struct program *)a;    if(!a) {    fprintf (stderr, "%*s**NULL pointer\n", indent, "");
pike.git/src/gc.c:1864:    m->flags |= GC_NOT_REFERENCED;    return ret;   }      static void cleanup_markers (void)   {   #ifdef DO_PIKE_CLEANUP    size_t e=0;       if (gc_keep_markers) { -  /* Carry over any GC_CLEANUP_FREED flags but reinitialize them +  /* Carry over any GC_CLEANUP_LEAKED flags but reinitialize them    * otherwise. */    for(e=0;e<marker_hash_table_size;e++) {    struct marker *m;    for (m = marker_hash_table[e]; m; m = m->next) {   #ifdef PIKE_DEBUG -  m->flags &= GC_CLEANUP_FREED; +  m->flags &= GC_CLEANUP_LEAKED;    m->xrefs = 0;    m->saved_refs = -1;   #else    m->flags = 0;   #endif    m->refs = m->weak_refs = 0;    m->frame = 0;    }    }    return;
pike.git/src/gc.c:1933: Inside #if defined(PIKE_DEBUG)
   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)) +  if (m && (m->flags & GC_CLEANUP_LEAKED))    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);   }      /* 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)
pike.git/src/gc.c:1980: 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(); -  debug_gc_check_all_types(); +  gc_check_all_types();    } 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    }