mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Hide bin slab-locality query behind arena_locality_hint
bin_t is an arena implementation detail; tcache should not reach into it. Extract the slab-address lookup into bin.c as bin_current_slab_addr, and expose it to tcache only through arena_locality_hint(tsdn, arena, szind), which composes bin_choose + bin_current_slab_addr.
This commit is contained in:
parent
e286fba00a
commit
3c1c6ae419
6 changed files with 71 additions and 23 deletions
|
|
@ -211,6 +211,14 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
|||
}
|
||||
}
|
||||
|
||||
void *
|
||||
arena_locality_hint(tsdn_t *tsdn, arena_t *arena, szind_t szind) {
|
||||
assert(szind < SC_NBINS);
|
||||
bin_t *bin = bin_choose(tsdn, arena, szind, NULL);
|
||||
assert(bin != NULL);
|
||||
return bin_current_slab_addr(tsdn, bin);
|
||||
}
|
||||
|
||||
static void
|
||||
arena_background_thread_inactivity_check(
|
||||
tsdn_t *tsdn, arena_t *arena, bool is_background_thread) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue