Lines Matching refs:stats

58 #define COUNT(pool,what)  (pool)->stats.what++
123 memset(&pool->stats, 0, sizeof pool->stats);
124 pool->stats.name = strdup(name);
125 pool->stats.next = arena_stats_list;
126 arena_stats_list = &pool->stats;
316 PLArenaStats *stats, **statsp;
318 if (pool->stats.name)
319 PR_DELETE(pool->stats.name);
320 for (statsp = &arena_stats_list; (stats = *statsp) != 0;
321 statsp = &stats->next) {
322 if (stats == &pool->stats) {
323 *statsp = stats->next;
365 pool->stats.nallocs++;
366 pool->stats.nbytes += nb;
367 if (nb > pool->stats.maxalloc)
368 pool->stats.maxalloc = nb;
369 pool->stats.variance += nb * nb;
375 pool->stats.ninplace++;
381 pool->stats.ngrows++;
382 pool->stats.nbytes += incr;
383 pool->stats.variance -= size * size;
385 if (size > pool->stats.maxalloc)
386 pool->stats.maxalloc = size;
387 pool->stats.variance += size * size;
392 pool->stats.nreleases++;
397 pool->stats.nfastrels++;
405 PLArenaStats *stats;
408 for (stats = arena_stats_list; stats; stats = stats->next) {
409 if (stats->nallocs != 0) {
410 mean = (double)stats->nbytes / stats->nallocs;
411 variance = fabs(stats->variance / stats->nallocs - mean * mean);
416 fprintf(fp, "\n%s allocation statistics:\n", stats->name);
417 fprintf(fp, " number of arenas: %u\n", stats->narenas);
418 fprintf(fp, " number of allocations: %u\n", stats->nallocs);
419 fprintf(fp, " number of free arena reclaims: %u\n", stats->nreclaims);
420 fprintf(fp, " number of malloc calls: %u\n", stats->nmallocs);
421 fprintf(fp, " number of deallocations: %u\n", stats->ndeallocs);
422 fprintf(fp, " number of allocation growths: %u\n", stats->ngrows);
423 fprintf(fp, " number of in-place growths: %u\n", stats->ninplace);
424 fprintf(fp, "number of released allocations: %u\n", stats->nreleases);
425 fprintf(fp, " number of fast releases: %u\n", stats->nfastrels);
426 fprintf(fp, " total bytes allocated: %u\n", stats->nbytes);
429 fprintf(fp, " maximum allocation size: %u\n", stats->maxalloc);