pike.git / src / main.c

version» Context lines:

pike.git/src/main.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: main.c,v 1.211 2004/09/30 11:57:53 mast Exp $ + || $Id: main.c,v 1.212 2004/09/30 14:07:19 mast Exp $   */      #include "global.h"   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"
pike.git/src/main.c:1060:    REPORT_LINKED_LIST_LEAKS (mapping, first_mapping, {}, T_MAPPING, "Mapping");    REPORT_LINKED_LIST_LEAKS (program, first_program, {}, T_PROGRAM, "Program");    REPORT_LINKED_LIST_LEAKS (object, first_object, {}, T_OBJECT, "Object");      #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. +  * Ideally we should only free the svalues inside these things but +  * leave the blocks themselves. */ +    #define ZAP_LINKED_LIST_LEAKS(TYPE, START, STATICS) do { \    struct TYPE *x, *next; \    for (x = START; x; x = next) { \    struct marker *m = find_marker (x); \    next = x->next; \    if (m) { \    int is_static = 0; \    static const struct TYPE *statics[] = STATICS; \    ptrdiff_t i; /* Use signed type to avoid warnings from gcc. */ \    INT32 refs; \
pike.git/src/main.c:1097:    ZAP_LINKED_LIST_LEAKS (object, first_object, {});      #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)