From: Bruno Haible Date: Fri, 12 Sep 2025 23:46:42 +0000 (+0200) Subject: pagealign_alloc: Tweak the benchmark. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96a905cda7e941862ffcbf12e720824612c446c7;p=thirdparty%2Fgnulib.git pagealign_alloc: Tweak the benchmark. * tests/bench-pagealign_alloc.c (show_stats): Reformat. (main): Fix usage message. --- diff --git a/ChangeLog b/ChangeLog index 209e6b08eb..9b45e80a86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-09-12 Bruno Haible + + pagealign_alloc: Tweak the benchmark. + * tests/bench-pagealign_alloc.c (show_stats): Reformat. + (main): Fix usage message. + 2025-09-12 Bruno Haible vma-iter: Improve on OpenBSD. diff --git a/tests/bench-pagealign_alloc.c b/tests/bench-pagealign_alloc.c index bdba5bfecf..3366fd100d 100644 --- a/tests/bench-pagealign_alloc.c +++ b/tests/bench-pagealign_alloc.c @@ -67,11 +67,15 @@ show_stats (intptr_t initial_as, intptr_t initial_data, int count) intptr_t requested = count * size_of_some_pages (); intptr_t as_increase = get_rusage_as () - initial_as; intptr_t data_increase = get_rusage_data () - initial_data; - printf ("count = %5d: requested: %6ld pages, allocated AS: %6ld pages (%.2f%%), allocated DATA: %6ld pages (%.2f%%)\n", + printf ("count = %5d: requested: %6ld pages, " + "allocated AS: %6ld pages (%.2f%%), " + "allocated DATA: %6ld pages (%.2f%%)\n", count, (long int) (requested / pagesize), - (long int) (as_increase / pagesize), 100 * (double) as_increase / (double) requested, - (long int) (data_increase / pagesize), 100 * (double) data_increase / (double) requested); + (long int) (as_increase / pagesize), + 100 * (double) as_increase / (double) requested, + (long int) (data_increase / pagesize), + 100 * (double) data_increase / (double) requested); } } @@ -99,7 +103,7 @@ main (int argc, char *argv[]) if (argc != 2) { fprintf (stderr, "Usage: %s TESTS\n", argv[0]); - fprintf (stderr, "Example: %s abcdef\n", argv[0]); + fprintf (stderr, "Example: %s {a|b|c|d|e|f}\n", argv[0]); exit (1); }