From 2df57ad95cb48f21e63b5ab882b268f5b8fda198 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 9 May 2025 14:24:42 +0000 Subject: [PATCH] benchtests: Cleanup bench-malloc-thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change duration to 3 seconds.  Add spaces before '('. Reviewed-by: DJ Delorie --- benchtests/bench-malloc-thread.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/benchtests/bench-malloc-thread.c b/benchtests/bench-malloc-thread.c index d16befaeaf..7759c61847 100644 --- a/benchtests/bench-malloc-thread.c +++ b/benchtests/bench-malloc-thread.c @@ -17,7 +17,7 @@ . */ #ifndef TEST_FUNC -# define TEST_FUNC(size) malloc(size) +# define TEST_FUNC(size) malloc (size) # define TEST_NAME "malloc" #endif @@ -36,7 +36,7 @@ #include "json-lib.h" /* Benchmark duration in seconds. */ -#define BENCHMARK_DURATION 10 +#define BENCHMARK_DURATION 3 #define RAND_SEED 88 #ifndef NUM_THREADS @@ -206,12 +206,12 @@ do_benchmark (size_t num_threads, size_t *iters) for (size_t i = 0; i < num_threads; i++) { args[i].working_set = working_set[i]; - pthread_create(&threads[i], NULL, benchmark_thread, &args[i]); + pthread_create (&threads[i], NULL, benchmark_thread, &args[i]); } for (size_t i = 0; i < num_threads; i++) { - pthread_join(threads[i], NULL); + pthread_join (threads[i], NULL); TIMING_ACCUM (elapsed, args[i].elapsed); *iters += args[i].iters; } @@ -219,7 +219,7 @@ do_benchmark (size_t num_threads, size_t *iters) return elapsed; } -static void usage(const char *name) +static void usage (const char *name) { fprintf (stderr, "%s: \n", name); exit (1); @@ -241,15 +241,15 @@ main (int argc, char **argv) long ret; errno = 0; - ret = strtol(argv[1], NULL, 10); + ret = strtol (argv[1], NULL, 10); if (errno || ret == 0) - usage(argv[0]); + usage (argv[0]); num_threads = ret; } else - usage(argv[0]); + usage (argv[0]); init_random_values (); @@ -275,7 +275,7 @@ main (int argc, char **argv) cur = do_benchmark (num_threads, &iters); struct rusage usage; - getrusage(RUSAGE_SELF, &usage); + getrusage (RUSAGE_SELF, &usage); d_total_s = cur; d_total_i = iters; -- 2.47.2