Branch: Tag:

2004-09-27

2004-09-27 21:37:13 by Martin Stjernholm <mast@lysator.liu.se>

Fixed --with-cleanup-on-exit to work without rtldebug.

Rev: src/array.h:1.62
Rev: src/dmalloc.h:1.52
Rev: src/gc.c:1.254
Rev: src/gc.h:1.113
Rev: src/main.c:1.203
Rev: src/mapping.h:1.56
Rev: src/multiset.h:1.36
Rev: src/object.h:1.86
Rev: src/pike_memory.c:1.152
Rev: src/program.h:1.204
Rev: src/stralloc.c:1.166
Rev: src/stralloc.h:1.82

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.253 2004/04/18 02:16:05 mast Exp $ + || $Id: gc.c,v 1.254 2004/09/27 21:37:13 mast Exp $   */      #include "global.h"
33:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.253 2004/04/18 02:16:05 mast Exp $"); + RCSID("$Id: gc.c,v 1.254 2004/09/27 21:37:13 mast Exp $");      int gc_enabled = 1;   
257:   const char *gc_found_place = NULL;   #endif    + #ifdef DO_PIKE_CLEANUP + /* To keep the markers after the gc. Only used for the leak report at exit. */ + int gc_keep_markers = 0; + int gc_external_refs_zapped = 0; + #endif +    #ifdef PIKE_DEBUG      #undef get_marker
340:      char *fatal_after_gc=0;    - #ifdef DO_PIKE_CLEANUP - /* To keep the markers after the gc. Only used for the leak report at exit. */ - int gc_keep_markers = 0; - int gc_external_refs_zapped = 0; - #endif -  +    #define DESCRIBE_MEM 1   #define DESCRIBE_SHORT 4   #define DESCRIBE_NO_DMALLOC 8
1536: Inside #if defined(DO_PIKE_CLEANUP)
   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;    }    }
1556: Inside #if defined(PIKE_DEBUG)
  {   #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    }
1779: Inside #if defined(PIKE_DEBUG)
   return 0;   }    - #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);