| 36 | } |
| 37 | |
| 38 | static void run_slab() { |
| 39 | struct hc_slab_alloc a; |
| 40 | hc_slab_alloc_init(&a, &hc_malloc_default, N); |
| 41 | hc_time_t t = hc_now(); |
| 42 | |
| 43 | for (int i = 0; i < N; i++) { |
| 44 | hc_acquire(&a.malloc, GET_SIZE()); |
| 45 | } |
| 46 | |
| 47 | hc_slab_alloc_deinit(&a); |
| 48 | hc_time_print(&t, "slab: "); |
| 49 | } |
| 50 | |
| 51 | void malloc2_benchmarks() { |
| 52 | const int s = time(NULL); |
no test coverage detected