| 509 | } |
| 510 | |
| 511 | static void |
| 512 | tcache_flush_cache(tsd_t *tsd, tcache_t *tcache) { |
| 513 | assert(tcache->arena != NULL); |
| 514 | |
| 515 | for (unsigned i = 0; i < SC_NBINS; i++) { |
| 516 | cache_bin_t *tbin = tcache_small_bin_get(tcache, i); |
| 517 | tcache_bin_flush_small(tsd, tcache, tbin, i, 0); |
| 518 | |
| 519 | if (config_stats) { |
| 520 | assert(tbin->tstats.nrequests == 0); |
| 521 | } |
| 522 | } |
| 523 | for (unsigned i = SC_NBINS; i < nhbins; i++) { |
| 524 | cache_bin_t *tbin = tcache_large_bin_get(tcache, i); |
| 525 | tcache_bin_flush_large(tsd, tbin, i, 0, tcache); |
| 526 | |
| 527 | if (config_stats) { |
| 528 | assert(tbin->tstats.nrequests == 0); |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | if (config_prof && tcache->prof_accumbytes > 0 && |
| 533 | arena_prof_accum(tsd_tsdn(tsd), tcache->arena, |
| 534 | tcache->prof_accumbytes)) { |
| 535 | prof_idump(tsd_tsdn(tsd)); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | void |
| 540 | tcache_flush(tsd_t *tsd) { |
no test coverage detected