Simplify arena_migrate() to take arena_t* instead of indices.

This makes debugging slightly easier and avoids the confusion of "should we
create new arenas" here.
This commit is contained in:
Qi Wang
2022-01-10 13:34:07 -08:00
committed by Qi Wang
parent 648b3b9f76
commit ddb170b1d9
4 changed files with 6 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ void arena_set(unsigned ind, arena_t *arena);
unsigned narenas_total_get(void);
arena_t *arena_init(tsdn_t *tsdn, unsigned ind, const arena_config_t *config);
arena_t *arena_choose_hard(tsd_t *tsd, bool internal);
void arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind);
void arena_migrate(tsd_t *tsd, arena_t *oldarena, arena_t *newarena);
void iarena_cleanup(tsd_t *tsd);
void arena_cleanup(tsd_t *tsd);
size_t batch_alloc(void **ptrs, size_t num, size_t size, int flags);

View File

@@ -16,7 +16,7 @@ percpu_arena_update(tsd_t *tsd, unsigned cpu) {
assert(newarena != NULL);
/* Set new arena/tcache associations. */
arena_migrate(tsd, oldind, newind);
arena_migrate(tsd, oldarena, newarena);
tcache_t *tcache = tcache_get(tsd);
if (tcache != NULL) {
tcache_slow_t *tcache_slow = tsd_tcache_slowp_get(tsd);