int main(void) { rcu_register_thread(); radix_tree_init(); regression1_test(); regression2_test(); regression3_test(); single_thread_tests(); sleep(1); printf("after sleep(1): %d allocated\n", nr_allocated); rcu_unregister_thread(); exit(0); }
int main(int argc, char **argv) { bool long_run = false; int opt; unsigned int seed = time(NULL); while ((opt = getopt(argc, argv, "ls:v")) != -1) { if (opt == 'l') long_run = true; else if (opt == 's') seed = strtoul(optarg, NULL, 0); else if (opt == 'v') test_verbose++; } printf("random seed %u\n", seed); srand(seed); printf("running tests\n"); rcu_register_thread(); radix_tree_init(); xarray_tests(); regression1_test(); regression2_test(); regression3_test(); regression4_test(); iteration_test(0, 10 + 90 * long_run); iteration_test(7, 10 + 90 * long_run); single_thread_tests(long_run); /* Free any remaining preallocated nodes */ radix_tree_cpu_dead(0); benchmark(); rcu_barrier(); printv(2, "after rcu_barrier: %d allocated, preempt %d\n", nr_allocated, preempt_count); rcu_unregister_thread(); printf("tests completed\n"); exit(0); }