Deleted Added
sdiff udiff text old ( 242844 ) new ( 245868 )
full compact
1#define JEMALLOC_TCACHE_C_
2#include "jemalloc/internal/jemalloc_internal.h"
3
4/******************************************************************************/
5/* Data. */
6
7malloc_tsd_data(, tcache, tcache_t *, NULL)
8malloc_tsd_data(, tcache_enabled, tcache_enabled_t, tcache_enabled_default)

--- 83 unchanged lines hidden (view full) ---

92 for (nflush = tbin->ncached - rem; nflush > 0; nflush = ndeferred) {
93 /* Lock the arena bin associated with the first object. */
94 arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(
95 tbin->avail[0]);
96 arena_t *arena = chunk->arena;
97 arena_bin_t *bin = &arena->bins[binind];
98
99 if (config_prof && arena == tcache->arena) {
100 arena_prof_accum(arena, tcache->prof_accumbytes);
101 tcache->prof_accumbytes = 0;
102 }
103
104 malloc_mutex_lock(&bin->lock);
105 if (config_stats && arena == tcache->arena) {
106 assert(merged_stats == false);
107 merged_stats = true;
108 bin->stats.nflushes++;

--- 64 unchanged lines hidden (view full) ---

173 /* Lock the arena associated with the first object. */
174 arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(
175 tbin->avail[0]);
176 arena_t *arena = chunk->arena;
177
178 malloc_mutex_lock(&arena->lock);
179 if ((config_prof || config_stats) && arena == tcache->arena) {
180 if (config_prof) {
181 arena_prof_accum_locked(arena,
182 tcache->prof_accumbytes);
183 tcache->prof_accumbytes = 0;
184 }
185 if (config_stats) {
186 merged_stats = true;
187 arena->stats.nrequests_large +=
188 tbin->tstats.nrequests;
189 arena->stats.lstats[binind - NBINS].nrequests +=

--- 146 unchanged lines hidden (view full) ---

336 malloc_mutex_lock(&arena->lock);
337 arena->stats.nrequests_large += tbin->tstats.nrequests;
338 arena->stats.lstats[i - NBINS].nrequests +=
339 tbin->tstats.nrequests;
340 malloc_mutex_unlock(&arena->lock);
341 }
342 }
343
344 if (config_prof && tcache->prof_accumbytes > 0)
345 arena_prof_accum(tcache->arena, tcache->prof_accumbytes);
346
347 tcache_size = arena_salloc(tcache, false);
348 if (tcache_size <= SMALL_MAXCLASS) {
349 arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache);
350 arena_t *arena = chunk->arena;
351 size_t pageind = ((uintptr_t)tcache - (uintptr_t)chunk) >>
352 LG_PAGE;
353 arena_chunk_map_t *mapelm = arena_mapp_get(chunk, pageind);

--- 116 unchanged lines hidden ---