Lines Matching refs:tcache
33 tcache_event_hard(tsd_t *tsd, tcache_t *tcache) in tcache_event_hard() argument
35 szind_t binind = tcache->next_gc_bin; in tcache_event_hard()
36 tcache_bin_t *tbin = &tcache->tbins[binind]; in tcache_event_hard()
44 tcache_bin_flush_small(tsd, tcache, tbin, binind, in tcache_event_hard()
49 - tbin->low_water + (tbin->low_water >> 2), tcache); in tcache_event_hard()
67 tcache->next_gc_bin++; in tcache_event_hard()
68 if (tcache->next_gc_bin == nhbins) in tcache_event_hard()
69 tcache->next_gc_bin = 0; in tcache_event_hard()
73 tcache_alloc_small_hard(tsd_t *tsd, arena_t *arena, tcache_t *tcache, in tcache_alloc_small_hard() argument
79 tcache->prof_accumbytes : 0); in tcache_alloc_small_hard()
81 tcache->prof_accumbytes = 0; in tcache_alloc_small_hard()
88 tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin, in tcache_bin_flush_small() argument
109 if (arena_prof_accum(arena, tcache->prof_accumbytes)) in tcache_bin_flush_small()
111 tcache->prof_accumbytes = 0; in tcache_bin_flush_small()
170 unsigned rem, tcache_t *tcache) in tcache_bin_flush_large() argument
195 tcache->prof_accumbytes); in tcache_bin_flush_large()
196 tcache->prof_accumbytes = 0; in tcache_bin_flush_large()
253 tcache_arena_associate(tcache_t *tcache, arena_t *arena) in tcache_arena_associate() argument
259 ql_elm_new(tcache, link); in tcache_arena_associate()
260 ql_tail_insert(&arena->tcache_ql, tcache, link); in tcache_arena_associate()
266 tcache_arena_reassociate(tcache_t *tcache, arena_t *oldarena, arena_t *newarena) in tcache_arena_reassociate() argument
269 tcache_arena_dissociate(tcache, oldarena); in tcache_arena_reassociate()
270 tcache_arena_associate(tcache, newarena); in tcache_arena_reassociate()
274 tcache_arena_dissociate(tcache_t *tcache, arena_t *arena) in tcache_arena_dissociate() argument
284 if (iter == tcache) { in tcache_arena_dissociate()
291 ql_remove(&arena->tcache_ql, tcache, link); in tcache_arena_dissociate()
292 tcache_stats_merge(tcache, arena); in tcache_arena_dissociate()
316 tcache_t *tcache; in tcache_create() local
328 tcache = ipallocztm(tsd, size, CACHELINE, true, false, true, in tcache_create()
330 if (tcache == NULL) in tcache_create()
333 tcache_arena_associate(tcache, arena); in tcache_create()
335 ticker_init(&tcache->gc_ticker, TCACHE_GC_INCR); in tcache_create()
339 tcache->tbins[i].lg_fill_div = 1; in tcache_create()
346 tcache->tbins[i].avail = (void **)((uintptr_t)tcache + in tcache_create()
350 return (tcache); in tcache_create()
354 tcache_destroy(tsd_t *tsd, tcache_t *tcache) in tcache_destroy() argument
360 tcache_arena_dissociate(tcache, arena); in tcache_destroy()
363 tcache_bin_t *tbin = &tcache->tbins[i]; in tcache_destroy()
364 tcache_bin_flush_small(tsd, tcache, tbin, i, 0); in tcache_destroy()
375 tcache_bin_t *tbin = &tcache->tbins[i]; in tcache_destroy()
376 tcache_bin_flush_large(tsd, tbin, i, 0, tcache); in tcache_destroy()
387 if (config_prof && tcache->prof_accumbytes > 0 && in tcache_destroy()
388 arena_prof_accum(arena, tcache->prof_accumbytes)) in tcache_destroy()
391 idalloctm(tsd, tcache, false, true, true); in tcache_destroy()
397 tcache_t *tcache; in tcache_cleanup() local
402 if ((tcache = tsd_tcache_get(tsd)) != NULL) { in tcache_cleanup()
403 tcache_destroy(tsd, tcache); in tcache_cleanup()
417 tcache_stats_merge(tcache_t *tcache, arena_t *arena) in tcache_stats_merge() argument
426 tcache_bin_t *tbin = &tcache->tbins[i]; in tcache_stats_merge()
435 tcache_bin_t *tbin = &tcache->tbins[i]; in tcache_stats_merge()
445 tcache_t *tcache; in tcaches_create() local
457 tcache = tcache_create(tsd, arena_get(0, false)); in tcaches_create()
458 if (tcache == NULL) in tcaches_create()
464 elm->tcache = tcache; in tcaches_create()
468 elm->tcache = tcache; in tcaches_create()
480 if (elm->tcache == NULL) in tcaches_elm_flush()
482 tcache_destroy(tsd, elm->tcache); in tcaches_elm_flush()
483 elm->tcache = NULL; in tcaches_elm_flush()