tcache.c (242844) | tcache.c (245868) |
---|---|
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) { | 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 malloc_mutex_lock(&arena->lock); | |
101 arena_prof_accum(arena, tcache->prof_accumbytes); | 100 arena_prof_accum(arena, tcache->prof_accumbytes); |
102 malloc_mutex_unlock(&arena->lock); | |
103 tcache->prof_accumbytes = 0; 104 } 105 106 malloc_mutex_lock(&bin->lock); 107 if (config_stats && arena == tcache->arena) { 108 assert(merged_stats == false); 109 merged_stats = true; 110 bin->stats.nflushes++; --- 64 unchanged lines hidden (view full) --- 175 /* Lock the arena associated with the first object. */ 176 arena_chunk_t *chunk = (arena_chunk_t *)CHUNK_ADDR2BASE( 177 tbin->avail[0]); 178 arena_t *arena = chunk->arena; 179 180 malloc_mutex_lock(&arena->lock); 181 if ((config_prof || config_stats) && arena == tcache->arena) { 182 if (config_prof) { | 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) { |
183 arena_prof_accum(arena, | 181 arena_prof_accum_locked(arena, |
184 tcache->prof_accumbytes); 185 tcache->prof_accumbytes = 0; 186 } 187 if (config_stats) { 188 merged_stats = true; 189 arena->stats.nrequests_large += 190 tbin->tstats.nrequests; 191 arena->stats.lstats[binind - NBINS].nrequests += --- 146 unchanged lines hidden (view full) --- 338 malloc_mutex_lock(&arena->lock); 339 arena->stats.nrequests_large += tbin->tstats.nrequests; 340 arena->stats.lstats[i - NBINS].nrequests += 341 tbin->tstats.nrequests; 342 malloc_mutex_unlock(&arena->lock); 343 } 344 } 345 | 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 |
346 if (config_prof && tcache->prof_accumbytes > 0) { 347 malloc_mutex_lock(&tcache->arena->lock); | 344 if (config_prof && tcache->prof_accumbytes > 0) |
348 arena_prof_accum(tcache->arena, tcache->prof_accumbytes); | 345 arena_prof_accum(tcache->arena, tcache->prof_accumbytes); |
349 malloc_mutex_unlock(&tcache->arena->lock); 350 } | |
351 352 tcache_size = arena_salloc(tcache, false); 353 if (tcache_size <= SMALL_MAXCLASS) { 354 arena_chunk_t *chunk = CHUNK_ADDR2BASE(tcache); 355 arena_t *arena = chunk->arena; 356 size_t pageind = ((uintptr_t)tcache - (uintptr_t)chunk) >> 357 LG_PAGE; 358 arena_chunk_map_t *mapelm = arena_mapp_get(chunk, pageind); --- 116 unchanged lines hidden --- | 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 --- |