MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / eval_alloc_perf

Function eval_alloc_perf

random/allocator.c:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void eval_alloc_perf() {
80 const char *allocator_names[] = {"malloc", "g_malloc", "g_slice_alloc", "my_malloc"};
81 const allocator allocators[] = {malloc, g_malloc, g_slice_alloc, aligned_alloc2};
82 const free_func free_funcs[] = {free, g_free, g_slice_free2, free};
83 const workload_func workloads[] = {workload0, workload1};
84
85
86 struct rusage r_usage_before, r_usage_after;
87 getrusage(RUSAGE_SELF, &r_usage_before);
88
89 workloads[workload_idx](allocators[alloc_type], allocator_names[alloc_type]);
90
91// for (int i = 0; i < N; i++)
92// free_funcs[alloc_type](it[i]);
93
94 getrusage(RUSAGE_SELF, &r_usage_after);
95 print_rusage_diff(r_usage_before, r_usage_after);
96
97
98// sleep(20);
99}
100
101
102/**

Callers 1

mainFunction · 0.85

Calls 1

print_rusage_diffFunction · 0.70

Tested by

no test coverage detected