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.169 2003/03/30 02:08:08 mast Exp $ + || $Id: main.c,v 1.170 2003/03/30 17:15:09 mast Exp $   */      #include "global.h" - RCSID("$Id: main.c,v 1.169 2003/03/30 02:08:08 mast Exp $"); + RCSID("$Id: main.c,v 1.170 2003/03/30 17:15:09 mast Exp $");   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "language.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/main.c:811:       init_builtin();       init_builtin_efuns();    init_signals();    init_dynamic_load();   }      void exit_main(void)   { + #ifdef DO_PIKE_CLEANUP +  /* Destruct all remaining objects before modules are shut down, so +  * that they don't get calls to object exit callbacks after their +  * module exit callback. The downside is that the leak report below +  * will always report destructed objects. */ +  cleanup_objects(); + #endif   }      void init_main(void)   {   }      void low_exit_main(void)   {   #ifdef DO_PIKE_CLEANUP    void exit_iterators(void);
pike.git/src/main.c:852: Inside #if defined(DO_PIKE_CLEANUP)
   cleanup_gc();    cleanup_pike_types();      #ifdef SHARED_NODES    free(node_hash.table);   #endif /* SHARED_NODES */       exit_pike_security();    free_svalue(& throw_value);    throw_value.type=T_INT; +     {   #ifdef DEBUG_MALLOC -  gc_keep_markers = 1; +  gc_keep_markers = verbose_debug_exit;   #endif    while(1) {    int tmp=num_objects;    do_gc(NULL, 1);    if(num_objects >= tmp) break;    }    }    - #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC) + #ifdef DEBUG_MALLOC    if(verbose_debug_exit)    {    fprintf(stderr,"Exited normally, counting bytes.\n");      #ifdef _REENTRANT    if(count_pike_threads()>1)    {    fprintf(stderr,"Byte counting aborted, because all threads have not exited properly.\n");    verbose_debug_exit=0;    return;
pike.git/src/main.c:890: Inside #if defined(DO_PIKE_CLEANUP)
   size_t num = 0; \    struct TYPE *x; \    for (x = START; x != END; x = x->next) { \    struct marker *m = find_marker (x); \    num++; \    if (!m) { \    fprintf (stderr, "Didn't find gc marker as expected for:\n"); \    describe_something (x, T_TYPE, 2, 2, 0, NULL); \    } \    else if (m->refs != x->refs) { \ -  fprintf (stderr, NAME " got %d extra external references:\n", \ +  fprintf (stderr, NAME " got %d unaccounted references:\n", \    x->refs - m->refs); \    describe_something (x, T_TYPE, 2, 2, 0, NULL); \    } \    } \    if (num) \    fprintf (stderr, NAME "s left: %"PRINTSIZET"d\n", num); \    } while (0)       REPORT_LINKED_LIST_LEAKS (array, &empty_array, &empty_array, T_ARRAY, "Array");    REPORT_LINKED_LIST_LEAKS (multiset, first_multiset, NULL, T_MULTISET, "Multiset");
pike.git/src/main.c:944:    do_gc (NULL, 1);       {    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();    }    } - #else -  gc_keep_markers = 0; -  do_gc (NULL, 1); +    #endif    -  cleanup_objects(); +  destruct_objects_to_destruct_cb();       really_clean_up_interpret();       cleanup_callbacks();    free_all_callable_blocks();    exit_destroy_called_mark_hash();       cleanup_pike_type_table();    cleanup_shared_string_table();