• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/jemalloc/src/

Lines Matching refs:tsd

40 tcache_event_hard(tsd_t *tsd, tcache_t *tcache) {
54 tcache_bin_flush_small(tsd, tcache, tbin, binind,
67 tcache_bin_flush_large(tsd, tbin, binind, tbin->ncached
104 tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, cache_bin_t *tbin,
117 item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));
127 if (arena_prof_accum(tsd_tsdn(tsd), arena,
129 prof_idump(tsd_tsdn(tsd));
134 malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock);
149 arena_dalloc_bin_junked_locked(tsd_tsdn(tsd),
163 malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock);
164 arena_decay_ticks(tsd_tsdn(tsd), bin_arena, nflush - ndeferred);
173 malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock);
177 malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock);
189 tcache_bin_flush_large(tsd_t *tsd, cache_bin_t *tbin, szind_t binind,
202 item_extent[i] = iealloc(tsd_tsdn(tsd), *(tbin->avail - 1 - i));
215 malloc_mutex_lock(tsd_tsdn(tsd), &locked_arena->large_mtx);
221 large_dalloc_prep_junked_locked(tsd_tsdn(tsd),
227 idump = arena_prof_accum(tsd_tsdn(tsd), arena,
233 arena_stats_large_nrequests_add(tsd_tsdn(tsd),
239 malloc_mutex_unlock(tsd_tsdn(tsd), &locked_arena->large_mtx);
248 large_dalloc_finish(tsd_tsdn(tsd), extent);
262 prof_idump(tsd_tsdn(tsd));
264 arena_decay_ticks(tsd_tsdn(tsd), locked_arena, nflush -
273 arena_stats_large_nrequests_add(tsd_tsdn(tsd), &arena->stats,
341 tsd_tcache_enabled_data_init(tsd_t *tsd) {
342 /* Called upon tsd initialization. */
343 tsd_tcache_enabled_set(tsd, opt_tcache);
344 tsd_slow_update(tsd);
348 tsd_tcache_data_init(tsd);
356 tcache_init(tsd_t *tsd, tcache_t *tcache, void *avail_stack) {
390 tsd_tcache_data_init(tsd_t *tsd) {
391 tcache_t *tcache = tsd_tcachep_get_unsafe(tsd);
397 void *avail_array = ipallocztm(tsd_tsdn(tsd), size, CACHELINE, true,
403 tcache_init(tsd, tcache, avail_array);
408 * functional tsd, and it can only rely on a0. In that case, we
416 arena = arena_get(tsd_tsdn(tsd), 0, false);
417 tcache_arena_associate(tsd_tsdn(tsd), tcache, arena);
419 arena = arena_choose(tsd, NULL);
422 tcache_arena_associate(tsd_tsdn(tsd), tcache, arena);
432 tcache_create_explicit(tsd_t *tsd) {
444 tcache = ipallocztm(tsd_tsdn(tsd), size, CACHELINE, true, NULL, true,
450 tcache_init(tsd, tcache,
452 tcache_arena_associate(tsd_tsdn(tsd), tcache, arena_ichoose(tsd, NULL));
458 tcache_flush_cache(tsd_t *tsd, tcache_t *tcache) {
463 tcache_bin_flush_small(tsd, tcache, tbin, i, 0);
471 tcache_bin_flush_large(tsd, tbin, i, 0, tcache);
479 arena_prof_accum(tsd_tsdn(tsd), tcache->arena,
481 prof_idump(tsd_tsdn(tsd));
486 tcache_flush(tsd_t *tsd) {
487 assert(tcache_available(tsd));
488 tcache_flush_cache(tsd, tsd_tcachep_get(tsd));
492 tcache_destroy(tsd_t *tsd, tcache_t *tcache, bool tsd_tcache) {
493 tcache_flush_cache(tsd, tcache);
494 tcache_arena_dissociate(tsd_tsdn(tsd), tcache);
501 idalloctm(tsd_tsdn(tsd), avail_array, NULL, NULL, true, true);
504 idalloctm(tsd_tsdn(tsd), tcache, NULL, NULL, true, true);
510 tcache_cleanup(tsd_t *tsd) {
511 tcache_t *tcache = tsd_tcachep_get(tsd);
512 if (!tcache_available(tsd)) {
513 assert(tsd_tcache_enabled_get(tsd) == false);
519 assert(tsd_tcache_enabled_get(tsd));
522 tcache_destroy(tsd, tcache, true);
553 tcaches_create_prep(tsd_t *tsd) {
556 malloc_mutex_lock(tsd_tsdn(tsd), &tcaches_mtx);
559 tcaches = base_alloc(tsd_tsdn(tsd), b0get(), sizeof(tcache_t *)
574 malloc_mutex_unlock(tsd_tsdn(tsd), &tcaches_mtx);
579 tcaches_create(tsd_t *tsd, unsigned *r_ind) {
580 witness_assert_depth(tsdn_witness_tsdp_get(tsd_tsdn(tsd)), 0);
584 if (tcaches_create_prep(tsd)) {
589 tcache_t *tcache = tcache_create_explicit(tsd);
596 malloc_mutex_lock(tsd_tsdn(tsd), &tcaches_mtx);
608 malloc_mutex_unlock(tsd_tsdn(tsd), &tcaches_mtx);
612 witness_assert_depth(tsdn_witness_tsdp_get(tsd_tsdn(tsd)), 0);
617 tcaches_elm_remove(tsd_t *tsd, tcaches_t *elm) {
618 malloc_mutex_assert_owner(tsd_tsdn(tsd), &tcaches_mtx);
629 tcaches_flush(tsd_t *tsd, unsigned ind) {
630 malloc_mutex_lock(tsd_tsdn(tsd), &tcaches_mtx);
631 tcache_t *tcache = tcaches_elm_remove(tsd, &tcaches[ind]);
632 malloc_mutex_unlock(tsd_tsdn(tsd), &tcaches_mtx);
634 tcache_destroy(tsd, tcache, false);
639 tcaches_destroy(tsd_t *tsd, unsigned ind) {
640 malloc_mutex_lock(tsd_tsdn(tsd), &tcaches_mtx);
642 tcache_t *tcache = tcaches_elm_remove(tsd, elm);
645 malloc_mutex_unlock(tsd_tsdn(tsd), &tcaches_mtx);
647 tcache_destroy(tsd, tcache, false);