pike.git / src / module.c

version» Context lines:

pike.git/src/module.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: module.c,v 1.40 2006/07/04 21:31:30 mast Exp $ + || $Id: module.c,v 1.41 2007/04/25 21:58:33 mast Exp $   */      #include "global.h"   #include "module.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "builtin_functions.h"   #include "main.h"   #include "svalue.h"   #include "interpret.h"
pike.git/src/module.c:164:    is_static = 1; \    if (x->refs != m->refs + is_static) { \    if (!leak_found) { \    fputs ("Leak(s) found at exit:\n", stderr); \    leak_found = 1; \    } \    fprintf (stderr, NAME " got %d unaccounted references: ", \    x->refs - (m->refs + is_static)); \    print_short_svalue (stderr, (union anything *) &x, T_TYPE); \    fputc ('\n', stderr); \ -  DO_IF_DMALLOC (debug_malloc_dump_references (x, 0, 1, 0)); \ +  DO_IF_DMALLOC (debug_malloc_dump_references (x, 2, 1, 0)); \    } \    } \    } \    } while (0)       REPORT_LINKED_LIST_LEAKS (array, first_array, STATIC_ARRAYS, T_ARRAY, "Array");    REPORT_LINKED_LIST_LEAKS (multiset, first_multiset, NOTHING, T_MULTISET, "Multiset");    REPORT_LINKED_LIST_LEAKS (mapping, first_mapping, NOTHING, T_MAPPING, "Mapping");    REPORT_LINKED_LIST_LEAKS (program, first_program, NOTHING, T_PROGRAM, "Program");    REPORT_LINKED_LIST_LEAKS (object, first_object, NOTHING, T_OBJECT, "Object"); -  +  report_all_type_leaks();      #undef REPORT_LINKED_LIST_LEAKS       /* Just remove the extra external refs reported above and do    * another gc so that we don't report the blocks again in the low    * level dmalloc reports. */      #if 1    /* It can be a good idea to disable this to leave the blocks    * around to be reported by an external memchecker like valgrind.
pike.git/src/module.c:216:    } \    } \    } \    } while (0)       ZAP_LINKED_LIST_LEAKS (array, first_array, STATIC_ARRAYS);    ZAP_LINKED_LIST_LEAKS (multiset, first_multiset, NOTHING);    ZAP_LINKED_LIST_LEAKS (mapping, first_mapping, NOTHING);    ZAP_LINKED_LIST_LEAKS (program, first_program, NOTHING);    ZAP_LINKED_LIST_LEAKS (object, first_object, NOTHING); +  free_all_leaked_types();      #undef ZAP_LINKED_LIST_LEAKS      #ifdef PIKE_DEBUG    /* If we stumble on the real refs whose refcounts we've zapped    * above we should try to handle it gracefully. */    gc_external_refs_zapped = 1;   #endif      #endif       do_gc (NULL, 1);       gc_keep_markers = 0;    exit_gc(); -  - #ifdef DEBUG_MALLOC -  { -  INT32 num, size; -  count_memory_in_pike_types(&num, &size); -  if (num) -  fprintf(stderr, "Types left: %d (%d bytes)\n", num, size); -  describe_all_types(); +     } - #endif -  } +        destruct_objects_to_destruct_cb();       /* Now there are no arrays/objects/programs/anything left. */       really_clean_up_interpret();       cleanup_callbacks();    free_all_callable_blocks();    exit_destroy_called_mark_hash();