| 8 | #define GET_SIZE() ((rand() % MAX_SIZE) + 1) |
| 9 | |
| 10 | static void run_malloc() { |
| 11 | int *ps[N]; |
| 12 | hc_time_t t = hc_now(); |
| 13 | |
| 14 | for (int i = 0; i < N; i++) { |
| 15 | ps[i] = malloc(GET_SIZE()); |
| 16 | } |
| 17 | |
| 18 | for (int i = 0; i < N; i++) { |
| 19 | free(ps[i]); |
| 20 | } |
| 21 | |
| 22 | hc_time_print(&t, "malloc: "); |
| 23 | } |
| 24 | |
| 25 | static void run_bump() { |
| 26 | struct hc_bump_alloc a; |
no test coverage detected