pike.git / src / pike_modules.c

version» Context lines:

pike.git/src/pike_modules.c:55: Inside #if defined(DEBUG_MALLOC)
   * will still show up in the DO_PIKE_CLEANUP leak report if they    * leak, in spite of dmalloc_accept_leak. */    dmalloc_register (&empty_array, sizeof (empty_array),    DMALLOC_LOCATION());    dmalloc_accept_leak (&empty_array);    dmalloc_register (&weak_empty_array, sizeof (weak_empty_array),    DMALLOC_LOCATION());    dmalloc_accept_leak (&weak_empty_array);   #endif    +  TRACE("Init pike compiler...\n"); +  init_pike_compiler(); +     TRACE("Init String.Buffer...\n");    init_string_buffer();       TRACE("Init cpp...\n");    init_cpp();       TRACE("Init memory counter...\n");    init_mc();       TRACE("Init backend...\n");
pike.git/src/pike_modules.c:113: Inside #if defined(DO_PIKE_CLEANUP)
   /* Clear various global references. */       exit_sprintf();    exit_pike_searching();    exit_object();    exit_signals();    exit_builtin_efuns();    exit_builtin();    exit_cpp();    exit_string_buffer(); +  cleanup_pike_compiler();    cleanup_interpret();    exit_builtin_constants();    cleanup_module_support();    exit_operators();    exit_iterators();    exit_mc();    cleanup_program();    cleanup_error();    exit_backend();    cleanup_gc();
pike.git/src/pike_modules.c:135: Inside #if defined(DO_PIKE_CLEANUP) and #if defined(PIKE_THREADS)
  #ifdef PIKE_THREADS    /* This zaps Pike_interpreter.thread_state among other things, so    * THREADS_ALLOW/DISALLOW are NOPs beyond this point. */    th_cleanup();   #endif    free_all_pike_list_node_blocks();       free_svalue(& throw_value);    mark_free_svalue (&throw_value);    -  do_gc(NULL, 1); +  do_gc(1);       if (exit_with_cleanup)    {    int leak_found = 0;      #ifdef PIKE_THREADS    if(count_pike_threads())    {    fprintf(stderr,"Cleanup-on-exit aborted "    "because %d thread(s) still are running.\n",
pike.git/src/pike_modules.c:161: Inside #if defined(DO_PIKE_CLEANUP) and #if defined(DEBUG_MALLOC)
     #ifdef DEBUG_MALLOC    search_all_memheaders_for_references();   #endif       /* The use of markers below only works after a gc run where it    * hasn't freed anything. Since we've destructed all live objects    * in exit_modules, nothing should be left after the run above, so    * only one more run is necessary. */    gc_keep_markers = 1; -  do_gc (NULL, 1); +  do_gc (1);      #define STATIC_ARRAYS &empty_array, &weak_empty_array,      #define REPORT_LINKED_LIST_LEAKS(TYPE, START, STATICS, T_TYPE, NAME, \    PRINT_EXTRA) do { \    struct TYPE *x; \    for (x = START; x; x = x->next) { \    struct marker *m = find_marker (x); \    if (!m) { \    DO_IF_DEBUG ( \
pike.git/src/pike_modules.c:284:      #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 NULL}; \    ptrdiff_t i; /* Use signed type to avoid warnings from gcc. */ \ -  INT32 refs; \ +  INT32 refs, gc_refs; \    for (i = 0; i < (ptrdiff_t) (NELEM (statics) - 1); i++) \    if (x == statics[i]) \    is_static = 1; \    refs = x->refs; \ -  while (refs > m->gc_refs + is_static) { \ +  gc_refs = m->gc_refs; \ +  while (refs > gc_refs + is_static) { \    PIKE_CONCAT(free_, TYPE) (x); \    refs--; \    } \    } \    } \    } 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);
pike.git/src/pike_modules.c:312:       {    size_t index;    for (index = 0; index <= pike_type_hash_size; index++) {    ZAP_LINKED_LIST_LEAKS(pike_type, pike_type_hash[index], NOTHING);    }    }      #undef ZAP_LINKED_LIST_LEAKS    -  do_gc (NULL, 1); +  do_gc (1);       gc_keep_markers = 0;    exit_gc();    }       destruct_objects_to_destruct_cb();       /* Now there are no arrays/objects/programs/anything left. */       really_clean_up_interpret();
pike.git/src/pike_modules.c:479: Inside #if defined(DO_PIKE_CLEANUP)
   if (exit_with_cleanup) {    /* Kill the threads and destruct all remaining objects while we    * have a proper execution environment. The downside is that the    * leak report below will always report destructed objects. We use    * the gc in a special mode for this to get a reasonably sane    * destruct order. */   #ifdef PIKE_THREADS    cleanup_all_other_threads();   #endif    gc_destruct_everything = 1; -  count = do_gc (NULL, 1); +  count = do_gc (1);    while (count) { -  size_t new_count = do_gc (NULL, 1); +  size_t new_count = do_gc (1);    if (new_count >= count) {    fprintf (stderr, "Some _destruct function is creating new objects "    "during final cleanup - can't exit cleanly.\n");    break;    }    count = new_count;    }   #ifdef PIKE_DEBUG    if (!count) {    struct object *o;