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.258 2004/09/22 18:08:13 mast Exp $ + || $Id: gc.c,v 1.259 2004/09/27 21:37: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:1532: Inside #if defined(DO_PIKE_CLEANUP)
  {   #ifdef DO_PIKE_CLEANUP    size_t e=0;       if (gc_keep_markers) {    /* Carry over any GC_CLEANUP_FREED 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->refs = m->weak_refs = m->xrefs = 0; +  m->xrefs = 0;    m->saved_refs = -1; -  + #else +  m->flags = 0; + #endif +  m->refs = m->weak_refs = 0;    m->frame = 0;    }    }    return;    }       for(e=0;e<marker_hash_table_size;e++)    while(marker_hash_table[e])    remove_marker(marker_hash_table[e]->data);   #endif    exit_marker_hash();   }      static void init_gc(void)   {   #ifdef PIKE_DEBUG    if (!gc_is_watching) { -  + #endif + #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)    /* The marker hash table is left around after a previous gc if    * gc_keep_markers is set. */    if (marker_hash_table) cleanup_markers();    if (!marker_hash_table) - #endif +     low_init_marker_hash(num_objects); -  + #endif    get_marker(rec_list.data); /* Used to simplify fencepost conditions. */   #ifdef PIKE_DEBUG    }   #endif   }      void exit_gc(void)   {    if (gc_evaluator_callback) {    remove_callback(gc_evaluator_callback);
pike.git/src/gc.c:1588: 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 DO_PIKE_CLEANUP + #ifdef PIKE_DEBUG   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