| 312 | } |
| 313 | |
| 314 | void SlowLog_Free(SlowLog *slowlog) { |
| 315 | for(int i = 0; i < slowlog->count; i++) { |
| 316 | rax *lookup = slowlog->lookup[i]; |
| 317 | heap_t *heap = slowlog->min_heap[i]; |
| 318 | |
| 319 | raxIterator iter; |
| 320 | raxStart(&iter, lookup); |
| 321 | raxSeek(&iter, "^", NULL, 0); |
| 322 | while(raxNext(&iter)) { |
| 323 | SlowLogItem *item = iter.data; |
| 324 | _SlowLog_Item_Free(item); |
| 325 | } |
| 326 | raxStop(&iter); |
| 327 | |
| 328 | raxFree(lookup); |
| 329 | Heap_free(heap); |
| 330 | int res = pthread_mutex_destroy(slowlog->locks + i); |
| 331 | ASSERT(res == 0); |
| 332 | } |
| 333 | |
| 334 | rm_free(slowlog->locks); |
| 335 | rm_free(slowlog->lookup); |
| 336 | rm_free(slowlog->min_heap); |
| 337 | rm_free(slowlog); |
| 338 | } |
| 339 |
no test coverage detected