pike.git / src / gc.c

version» Context lines:

pike.git/src/gc.c:3500:   #endif   }      size_t do_gc(void *UNUSED(ignored), int explicit_call)   {    ALLOC_COUNT_TYPE start_allocs;    size_t start_num_objs, unreferenced;    cpu_time_t gc_start_time, gc_start_real_time;    ptrdiff_t objs, pre_kill_objs;   #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP) -  unsigned destroy_count; +  unsigned destruct_count;   #endif   #ifdef PIKE_DEBUG    unsigned obj_count;    ONERROR uwp;   #endif       if(Pike_in_gc) return 0;       if (gc_enabled <= 0 && (gc_enabled < 0 || !explicit_call)) {    /* If this happens then the gc has been disabled for a very long
pike.git/src/gc.c:3856:       /* Destruct the live objects in cycles, but first warn about any bad    * cycles. */    pre_kill_objs = num_objects;    if (Pike_interpreter.evaluator_stack && !gc_destruct_everything) {    objs -= num_objects;    warn_bad_cycles();    objs += num_objects;    }   #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP) -  destroy_count = 0; +  destruct_count = 0;   #endif       if (!SAFE_IS_ZERO(&gc_post_cb)) {    safe_apply_svalue(&gc_post_cb, 0, 1);    pop_stack();    }       {    enum object_destruct_reason reason =   #ifdef DO_PIKE_CLEANUP
pike.git/src/gc.c:3932:    push_int(reason);    push_int(o->refs - 1);    safe_apply_svalue(&gc_destruct_cb, 3, 1);    pop_stack();    }       destruct_object (o, reason);    free_object(o);    gc_free_extra_ref(o);   #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP) -  destroy_count++; +  destruct_count++;   #endif    really_free_gc_rec_frame (kill_list);    kill_list = next;    }    }      #ifdef PIKE_DEBUG    if (rec_frames)    Pike_fatal ("Leaked %u rec frames.\n", rec_frames);   #endif       GC_VERBOSE_DO(fprintf(stderr, "| kill: %u objects killed, "    "%"PRINTSIZET"u things really freed\n", -  destroy_count, pre_kill_objs - num_objects)); +  destruct_count, pre_kill_objs - num_objects));       Pike_in_gc=GC_PASS_DESTRUCT;    /* Destruct objects on the destruct queue. */    GC_VERBOSE_DO(obj_count = num_objects);    destruct_objects_to_destruct();    GC_VERBOSE_DO(fprintf(stderr, "| destruct: %d things really freed\n",    obj_count - num_objects));      #ifdef PIKE_DEBUG    if (gc_extra_refs) {
pike.git/src/gc.c:4171:    {    char timestr[40];    if (last_gc_time != (cpu_time_t) -1)    sprintf (timestr, ", %ld ms",    (long) (last_gc_time / (CPU_TIME_TICKS / 1000)));    else    timestr[0] = 0;   #ifdef DO_PIKE_CLEANUP    if (gc_destruct_everything)    fprintf(stderr, "done (%u %s destructed)%s\n", -  destroy_count, destroy_count == 1 ? "was" : "were", timestr); +  destruct_count, destruct_count == 1 ? "was" : "were", timestr);    else   #endif    fprintf(stderr, "done (%"PRINTSIZET"u of %"PRINTSIZET"u "    "%s unreferenced)%s\n",    unreferenced, start_num_objs,    unreferenced == 1 ? "was" : "were",    timestr);    }    }   
pike.git/src/gc.c:4203:    exit_gc();      #ifdef ALWAYS_GC    ADD_GC_CALLBACK();   #else    if(d_flag > 3) ADD_GC_CALLBACK();   #endif      #ifdef DO_PIKE_CLEANUP    if (gc_destruct_everything) -  return destroy_count; +  return destruct_count;   #endif       if (!SAFE_IS_ZERO(&gc_done_cb)) {    push_int(unreferenced);    safe_apply_svalue(&gc_done_cb, 1, 1);    pop_stack();    }       return unreferenced;   }