improve test-stress to run multiple iterations
@@ -19,6 +19,7 @@ terms of the MIT license.
// argument defaults
static int THREADS = 32; // more repeatable if THREADS <= #processors
static int N = 20; // scaling factor
+static int ITER = 10; // N full iterations re-creating all threads
// static int THREADS = 8; // more repeatable if THREADS <= #processors
// static int N = 100; // scaling factor
@@ -159,14 +160,17 @@ int main(int argc, char** argv) {
//bench_start_program();
mi_stats_reset();
+ for (int i = 0; i < ITER; i++) {
memset((void*)transfer, 0, TRANSFERS * sizeof(void*));
run_os_threads(THREADS);
for (int i = 0; i < TRANSFERS; i++) {
free_items((void*)transfer[i]);
}
+ }
#ifndef NDEBUG
mi_collect(false);
#endif
+
mi_stats_print(NULL);
//bench_end_program();
return 0;
