MCPcopy Create free account
hub / github.com/codr7/hacktical-c / run_slab

Function run_slab

malloc2/benchmarks.c:38–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static 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
51void malloc2_benchmarks() {
52 const int s = time(NULL);

Callers 1

malloc2_benchmarksFunction · 0.85

Calls 4

hc_slab_alloc_initFunction · 0.85
hc_nowFunction · 0.85
hc_slab_alloc_deinitFunction · 0.85
hc_time_printFunction · 0.85

Tested by

no test coverage detected