diff --git a/src/extent.c b/src/extent.c index 6b7da3f9..d08ccdb3 100644 --- a/src/extent.c +++ b/src/extent.c @@ -829,12 +829,16 @@ extent_recycle(tsdn_t *tsdn, arena_t *arena, extent_hooks_t **r_extent_hooks, rtree_ctx_t rtree_ctx_fallback; rtree_ctx_t *rtree_ctx = tsdn_rtree_ctx(tsdn, &rtree_ctx_fallback); + bool committed = false; extent_t *extent = extent_recycle_extract(tsdn, arena, r_extent_hooks, rtree_ctx, extents, false, new_addr, size, pad, alignment, slab, - zero, commit); + zero, &committed); if (extent == NULL) { return NULL; } + if (committed) { + *commit = true; + } extent = extent_recycle_split(tsdn, arena, r_extent_hooks, rtree_ctx, extents, new_addr, size, pad, alignment, slab, szind, extent); @@ -996,7 +1000,7 @@ extent_grow_retained(tsdn_t *tsdn, arena_t *arena, assert(new_addr == NULL || leadsize == 0); assert(alloc_size >= leadsize + esize); size_t trailsize = alloc_size - leadsize - esize; - if (extent_zeroed_get(extent)) { + if (extent_zeroed_get(extent) && extent_committed_get(extent)) { *zero = true; } if (extent_committed_get(extent)) { diff --git a/src/extent_mmap.c b/src/extent_mmap.c index b1862753..be099373 100644 --- a/src/extent_mmap.c +++ b/src/extent_mmap.c @@ -15,7 +15,9 @@ extent_alloc_mmap(void *new_addr, size_t size, size_t alignment, bool *zero, return NULL; } assert(ret != NULL); - *zero = true; + if (*commit) { + *zero = true; + } return ret; }