mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-26 06:46:28 +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
|
|
@ -111,6 +111,7 @@ arena_t *arena_choose_huge(tsd_t *tsd);
|
|||
size_t arena_fill_small_fresh(tsdn_t *tsdn, arena_t *arena, szind_t binind,
|
||||
void **ptrs, size_t nfill, bool zero);
|
||||
bool arena_boot(sc_data_t *sc_data, base_t *base, bool hpa);
|
||||
void *arena_locality_hint(tsdn_t *tsdn, arena_t *arena, szind_t szind);
|
||||
void arena_prefork0(tsdn_t *tsdn, arena_t *arena);
|
||||
void arena_prefork1(tsdn_t *tsdn, arena_t *arena);
|
||||
void arena_prefork2(tsdn_t *tsdn, arena_t *arena);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@ bool bin_refill_slabcur_no_fresh_slab(tsdn_t *tsdn, bool is_auto,
|
|||
void *bin_malloc_no_fresh_slab(tsdn_t *tsdn, bool is_auto, bin_t *bin,
|
||||
szind_t binind);
|
||||
|
||||
/* Slab queries. */
|
||||
void *bin_current_slab_addr(tsdn_t *tsdn, bin_t *bin);
|
||||
|
||||
/* Bin selection. */
|
||||
bin_t *bin_choose(tsdn_t *tsdn, arena_t *arena, szind_t binind,
|
||||
unsigned *binshard_p);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue