Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:5978: Inside #if 0
   while (1) {    sleep (10);    describe_all_threads();    }    });   #endif      #ifdef LOG_GC_TIMESTAMPS    Pike.gc_parameters(([ "pre_cb": lambda() {    gc_start = gethrtime(); +  gc_histogram = ([]);    werror("GC runs at %s", ctime(time()));    },    "post_cb":lambda() {    werror("GC done after %dus\n",    gethrtime() - gc_start);    },    "destruct_cb":lambda(object o) {    gc_histogram[sprintf("%O", object_program(o))]++;   #ifdef LOG_GC_VERBOSE    werror("GC cyclic reference in %O.\n",    o);   #endif    },    "done_cb":lambda(int n) {    if (!n) return;    werror("GC zapped %d things.\n", n); -  mapping h = gc_histogram + ([]); +  mapping h = gc_histogram; +  gc_histogram = ([]);    if (!sizeof(h)) return;    array i = indices(h);    array v = values(h);    sort(v, i); -  werror("GC histogram (accumulative):\n"); +  werror("GC histogram:\n");    foreach(reverse(i)[..9], string p) {    werror("GC: %s: %d\n", p, h[p]);    }    },    ]));    if (!Pike.gc_parameters()->pre_cb) {    // GC callbacks not available.    GCTimestamp();    }   #endif