Lines Matching refs:arena

74 tcache_alloc_small_hard(tsdn_t *tsdn, arena_t *arena, tcache_t *tcache,
79 arena_tcache_fill_small(tsdn, arena, tbin, binind, config_prof ?
92 arena_t *arena;
100 arena = arena_choose(tsd, NULL);
101 assert(arena != NULL);
103 /* Lock the arena bin associated with the first object. */
109 if (config_prof && bin_arena == arena) {
110 if (arena_prof_accum(tsd_tsdn(tsd), arena,
117 if (config_stats && bin_arena == arena) {
139 * arena bin than the one that is currently
153 * arena, so the stats didn't get merged. Manually do so now.
155 arena_bin_t *bin = &arena->bins[binind];
174 arena_t *arena;
182 arena = arena_choose(tsd, NULL);
183 assert(arena != NULL);
185 /* Lock the arena associated with the first object. */
194 if ((config_prof || config_stats) && locked_arena == arena) {
196 idump = arena_prof_accum_locked(arena,
202 arena->stats.nrequests_large +=
204 arena->stats.lstats[binind - NBINS].nrequests +=
221 * arena than the one that is currently locked.
238 * arena, so the stats didn't get merged. Manually do so now.
240 malloc_mutex_lock(tsd_tsdn(tsd), &arena->lock);
241 arena->stats.nrequests_large += tbin->tstats.nrequests;
242 arena->stats.lstats[binind - NBINS].nrequests +=
245 malloc_mutex_unlock(tsd_tsdn(tsd), &arena->lock);
256 tcache_arena_associate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena)
261 malloc_mutex_lock(tsdn, &arena->lock);
263 ql_tail_insert(&arena->tcache_ql, tcache, link);
264 malloc_mutex_unlock(tsdn, &arena->lock);
269 tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena)
274 malloc_mutex_lock(tsdn, &arena->lock);
278 ql_foreach(iter, &arena->tcache_ql, link) {
286 ql_remove(&arena->tcache_ql, tcache, link);
287 tcache_stats_merge(tsdn, tcache, arena);
288 malloc_mutex_unlock(tsdn, &arena->lock);
304 arena_t *arena;
311 arena = arena_choose(tsd, NULL);
312 if (unlikely(arena == NULL))
314 return (tcache_create(tsd_tsdn(tsd), arena));
318 tcache_create(tsdn_t *tsdn, arena_t *arena)
337 tcache_arena_associate(tsdn, tcache, arena);
360 arena_t *arena;
363 arena = arena_choose(tsd, NULL);
364 tcache_arena_dissociate(tsd_tsdn(tsd), tcache, arena);
371 arena_bin_t *bin = &arena->bins[i];
383 malloc_mutex_lock(tsd_tsdn(tsd), &arena->lock);
384 arena->stats.nrequests_large += tbin->tstats.nrequests;
385 arena->stats.lstats[i - NBINS].nrequests +=
387 malloc_mutex_unlock(tsd_tsdn(tsd), &arena->lock);
392 arena_prof_accum(tsd_tsdn(tsd), arena, tcache->prof_accumbytes))
420 tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena)
426 malloc_mutex_assert_owner(tsdn, &arena->lock);
430 arena_bin_t *bin = &arena->bins[i];
439 malloc_large_stats_t *lstats = &arena->stats.lstats[i - NBINS];
441 arena->stats.nrequests_large += tbin->tstats.nrequests;
450 arena_t *arena;
463 arena = arena_ichoose(tsdn, NULL);
464 if (unlikely(arena == NULL))
466 tcache = tcache_create(tsdn, arena);