| 455 | } |
| 456 | |
| 457 | static void |
| 458 | tcache_flush_cache(tsd_t *tsd, tcache_t *tcache) { |
| 459 | assert(tcache->arena != NULL); |
| 460 | |
| 461 | for (unsigned i = 0; i < NBINS; i++) { |
| 462 | cache_bin_t *tbin = tcache_small_bin_get(tcache, i); |
| 463 | tcache_bin_flush_small(tsd, tcache, tbin, i, 0); |
| 464 | |
| 465 | if (config_stats) { |
| 466 | assert(tbin->tstats.nrequests == 0); |
| 467 | } |
| 468 | } |
| 469 | for (unsigned i = NBINS; i < nhbins; i++) { |
| 470 | cache_bin_t *tbin = tcache_large_bin_get(tcache, i); |
| 471 | tcache_bin_flush_large(tsd, tbin, i, 0, tcache); |
| 472 | |
| 473 | if (config_stats) { |
| 474 | assert(tbin->tstats.nrequests == 0); |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | if (config_prof && tcache->prof_accumbytes > 0 && |
| 479 | arena_prof_accum(tsd_tsdn(tsd), tcache->arena, |
| 480 | tcache->prof_accumbytes)) { |
| 481 | prof_idump(tsd_tsdn(tsd)); |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | void |
| 486 | tcache_flush(tsd_t *tsd) { |
no test coverage detected