Lines Matching refs:tsd
33 tcache_event_hard(tsd_t *tsd, tcache_t *tcache) in tcache_event_hard() argument
44 tcache_bin_flush_small(tsd, tcache, tbin, binind, in tcache_event_hard()
48 tcache_bin_flush_large(tsd, tbin, binind, tbin->ncached in tcache_event_hard()
88 tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin, in tcache_bin_flush_small() argument
99 arena = arena_choose(tsd, NULL); in tcache_bin_flush_small()
103 extent_t *extent = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1)); in tcache_bin_flush_small()
108 if (arena_prof_accum(tsd_tsdn(tsd), arena, in tcache_bin_flush_small()
110 prof_idump(tsd_tsdn(tsd)); in tcache_bin_flush_small()
114 malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock); in tcache_bin_flush_small()
127 extent = iealloc(tsd_tsdn(tsd), ptr); in tcache_bin_flush_small()
129 arena_dalloc_bin_junked_locked(tsd_tsdn(tsd), in tcache_bin_flush_small()
142 malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock); in tcache_bin_flush_small()
143 arena_decay_ticks(tsd_tsdn(tsd), bin_arena, nflush - ndeferred); in tcache_bin_flush_small()
151 malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock); in tcache_bin_flush_small()
155 malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock); in tcache_bin_flush_small()
166 tcache_bin_flush_large(tsd_t *tsd, tcache_bin_t *tbin, szind_t binind, in tcache_bin_flush_large() argument
177 arena = arena_choose(tsd, NULL); in tcache_bin_flush_large()
181 extent_t *extent = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1)); in tcache_bin_flush_large()
187 malloc_mutex_lock(tsd_tsdn(tsd), &locked_arena->lock); in tcache_bin_flush_large()
207 extent = iealloc(tsd_tsdn(tsd), ptr); in tcache_bin_flush_large()
209 large_dalloc_junked_locked(tsd_tsdn(tsd), in tcache_bin_flush_large()
222 malloc_mutex_unlock(tsd_tsdn(tsd), &locked_arena->lock); in tcache_bin_flush_large()
224 prof_idump(tsd_tsdn(tsd)); in tcache_bin_flush_large()
225 arena_decay_ticks(tsd_tsdn(tsd), locked_arena, nflush - in tcache_bin_flush_large()
233 malloc_mutex_lock(tsd_tsdn(tsd), &arena->lock); in tcache_bin_flush_large()
238 malloc_mutex_unlock(tsd_tsdn(tsd), &arena->lock); in tcache_bin_flush_large()
292 tcache_get_hard(tsd_t *tsd) in tcache_get_hard() argument
297 if (tsd_nominal(tsd)) in tcache_get_hard()
301 arena = arena_choose(tsd, NULL); in tcache_get_hard()
304 return (tcache_create(tsd_tsdn(tsd), arena)); in tcache_get_hard()
348 tcache_destroy(tsd_t *tsd, tcache_t *tcache) in tcache_destroy() argument
353 arena = arena_choose(tsd, NULL); in tcache_destroy()
354 tcache_arena_dissociate(tsd_tsdn(tsd), tcache, arena); in tcache_destroy()
358 tcache_bin_flush_small(tsd, tcache, tbin, i, 0); in tcache_destroy()
367 tcache_bin_flush_large(tsd, tbin, i, 0, tcache); in tcache_destroy()
375 arena_prof_accum(tsd_tsdn(tsd), arena, tcache->prof_accumbytes)) in tcache_destroy()
376 prof_idump(tsd_tsdn(tsd)); in tcache_destroy()
378 idalloctm(tsd_tsdn(tsd), iealloc(tsd_tsdn(tsd), tcache), tcache, NULL, in tcache_destroy()
383 tcache_cleanup(tsd_t *tsd) in tcache_cleanup() argument
390 if ((tcache = tsd_tcache_get(tsd)) != NULL) { in tcache_cleanup()
391 tcache_destroy(tsd, tcache); in tcache_cleanup()
392 tsd_tcache_set(tsd, NULL); in tcache_cleanup()
425 tcaches_create(tsd_t *tsd, unsigned *r_ind) in tcaches_create() argument
432 tcaches = base_alloc(tsd_tsdn(tsd), b0get(), sizeof(tcache_t *) in tcaches_create()
440 arena = arena_ichoose(tsd, NULL); in tcaches_create()
443 tcache = tcache_create(tsd_tsdn(tsd), arena); in tcaches_create()
463 tcaches_elm_flush(tsd_t *tsd, tcaches_t *elm) in tcaches_elm_flush() argument
467 tcache_destroy(tsd, elm->tcache); in tcaches_elm_flush()
472 tcaches_flush(tsd_t *tsd, unsigned ind) in tcaches_flush() argument
474 tcaches_elm_flush(tsd, &tcaches[ind]); in tcaches_flush()
478 tcaches_destroy(tsd_t *tsd, unsigned ind) in tcaches_destroy() argument
481 tcaches_elm_flush(tsd, elm); in tcaches_destroy()