Purge all if the last thread migrated away from an arena.

This commit is contained in:
Qi Wang 2022-01-06 16:54:01 -08:00 committed by Qi Wang
parent c91e62dd37
commit 61978bbe69

View File

@ -472,6 +472,12 @@ arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind) {
arena_nthreads_dec(oldarena, false); arena_nthreads_dec(oldarena, false);
arena_nthreads_inc(newarena, false); arena_nthreads_inc(newarena, false);
tsd_arena_set(tsd, newarena); tsd_arena_set(tsd, newarena);
if (arena_nthreads_get(oldarena, false) == 0) {
/* Purge if the old arena has no associated threads anymore. */
arena_decay(tsd_tsdn(tsd), oldarena,
/* is_background_thread */ false, /* all */ true);
}
} }
static void static void