diff options
author | Eric Wong <e@80x24.org> | 2022-12-15 20:52:47 +0000 |
---|---|---|
committer | Eric Wong <mwrap-perl@80x24.org> | 2022-12-16 09:27:44 +0000 |
commit | 6188941e1b4707acf8053b8d12a5c56ee32a5e30 (patch) | |
tree | a17aaa40fe3f03f0db28267ddb6bf6f5627aa693 | |
parent | 3bc41454474a3c414888d751464f7bffd18fd9aa (diff) | |
download | mwrap-6188941e1b4707acf8053b8d12a5c56ee32a5e30.tar.gz |
`long double' is excessive, not necessary, and a waste of RAM and locality.
-rw-r--r-- | mwrap_httpd.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mwrap_httpd.h b/mwrap_httpd.h index 606ae20..3d2bf99 100644 --- a/mwrap_httpd.h +++ b/mwrap_httpd.h @@ -96,7 +96,7 @@ static MWRAP_TSD struct mw_h1req *tsd_h1r; /* sortable snapshot version of struct src_loc */ struct h1_src_loc { - long double mean_life; + double mean_life; size_t bytes; size_t allocations; size_t frees; @@ -484,8 +484,8 @@ static struct h1_src_loc *accumulate(unsigned long min, size_t *hslc, FILE *lp) hsl.frees = uatomic_read(&l->frees); hsl.live = hsl.allocations - hsl.frees; hsl.mean_life = hsl.frees ? - ((long double)uatomic_read(&l->age_total) / - (long double)hsl.frees) : + ((double)uatomic_read(&l->age_total) / + (double)hsl.frees) : HUGE_VAL; hsl.max_life = uatomic_read(&l->max_lifespan); hsl.sl = l; @@ -630,7 +630,7 @@ static enum mw_qev each_gt(struct mw_h1 *h1, struct mw_h1req *h1r, struct h1_src_loc *hsl = &hslv[i]; fprintf(fp, "<tr><td>%zu</td><td>%zu</td><td>%zu</td>" - "<td>%zu</td><td>%0.3Lf</td><td>%zu</td>", + "<td>%zu</td><td>%0.3f</td><td>%zu</td>", hsl->bytes, hsl->allocations, hsl->frees, hsl->live, hsl->mean_life, hsl->max_life); FPUTS("<td><a\nhref=\"../at/", fp); |