Skip to content

Commit

Permalink
Simplify / refactor tcache_dalloc_large.
Browse files Browse the repository at this point in the history
  • Loading branch information
interwq committed Aug 14, 2019
1 parent 9c5c2a2 commit e2c7584
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions include/jemalloc/internal/tcache_inlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,12 @@ tcache_dalloc_large(tsd_t *tsd, tcache_t *tcache, void *ptr, szind_t binind,

bin = tcache_large_bin_get(tcache, binind);
bin_info = &tcache_bin_info[binind];
if (unlikely(bin->ncached == bin_info->ncached_max)) {
if (unlikely(!cache_bin_dalloc_easy(bin, bin_info, ptr))) {
tcache_bin_flush_large(tsd, tcache, bin, binind,
(bin_info->ncached_max >> 1));
bool ret = cache_bin_dalloc_easy(bin, bin_info, ptr);
assert(ret);
}
assert(bin->ncached < bin_info->ncached_max);
bin->ncached++;
*(bin->avail - bin->ncached) = ptr;

tcache_event(tsd, tcache);
}
Expand Down

0 comments on commit e2c7584

Please sign in to comment.