| 2356 | } |
| 2357 | |
| 2358 | void |
| 2359 | prof_reset(tsd_t *tsd, size_t lg_sample) { |
| 2360 | prof_tdata_t *next; |
| 2361 | |
| 2362 | assert(lg_sample < (sizeof(uint64_t) << 3)); |
| 2363 | |
| 2364 | malloc_mutex_lock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 2365 | malloc_mutex_lock(tsd_tsdn(tsd), &tdatas_mtx); |
| 2366 | |
| 2367 | lg_prof_sample = lg_sample; |
| 2368 | |
| 2369 | next = NULL; |
| 2370 | do { |
| 2371 | prof_tdata_t *to_destroy = tdata_tree_iter(&tdatas, next, |
| 2372 | prof_tdata_reset_iter, (void *)tsd); |
| 2373 | if (to_destroy != NULL) { |
| 2374 | next = tdata_tree_next(&tdatas, to_destroy); |
| 2375 | prof_tdata_destroy_locked(tsd, to_destroy, false); |
| 2376 | } else { |
| 2377 | next = NULL; |
| 2378 | } |
| 2379 | } while (next != NULL); |
| 2380 | |
| 2381 | malloc_mutex_unlock(tsd_tsdn(tsd), &tdatas_mtx); |
| 2382 | malloc_mutex_unlock(tsd_tsdn(tsd), &prof_dump_mtx); |
| 2383 | } |
| 2384 | |
| 2385 | void |
| 2386 | prof_tdata_cleanup(tsd_t *tsd) { |
no test coverage detected