diff options
author | Qi Wang <interwq@gwu.edu> | 2019-07-24 16:12:06 -0700 |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2019-07-24 18:30:54 -0700 |
commit | bc0998a9052957584b6944b6f43fffe0648f603e (patch) | |
tree | 3e1de13f5fcd4efc56525dcfd59e4c6009dd6035 /include | |
parent | 1d148f353a2c71bc12fd066e467649fd17df3c95 (diff) |
Invoke arena_dalloc_promoted() properly w/o tcache.
When tcache was disabled, the dalloc promoted case was missing.
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/arena_inlines_b.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/jemalloc/internal/arena_inlines_b.h b/include/jemalloc/internal/arena_inlines_b.h index 7e61a44c..8b657abe 100644 --- a/include/jemalloc/internal/arena_inlines_b.h +++ b/include/jemalloc/internal/arena_inlines_b.h @@ -229,6 +229,16 @@ arena_vsalloc(tsdn_t *tsdn, const void *ptr) { } static inline void +arena_dalloc_large_no_tcache(tsdn_t *tsdn, void *ptr, szind_t szind) { + if (config_prof && unlikely(szind < SC_NBINS)) { + arena_dalloc_promoted(tsdn, ptr, NULL, true); + } else { + extent_t *extent = iealloc(tsdn, ptr); + large_dalloc(tsdn, extent); + } +} + +static inline void arena_dalloc_no_tcache(tsdn_t *tsdn, void *ptr) { assert(ptr != NULL); @@ -252,8 +262,7 @@ arena_dalloc_no_tcache(tsdn_t *tsdn, void *ptr) { /* Small allocation. */ arena_dalloc_small(tsdn, ptr); } else { - extent_t *extent = iealloc(tsdn, ptr); - large_dalloc(tsdn, extent); + arena_dalloc_large_no_tcache(tsdn, ptr, szind); } } @@ -349,8 +358,7 @@ arena_sdalloc_no_tcache(tsdn_t *tsdn, void *ptr, size_t size) { /* Small allocation. */ arena_dalloc_small(tsdn, ptr); } else { - extent_t *extent = iealloc(tsdn, ptr); - large_dalloc(tsdn, extent); + arena_dalloc_large_no_tcache(tsdn, ptr, szind); } } |