diff options
| author | Jason Evans <jasone@canonware.com> | 2016-06-08 18:41:24 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-06-08 18:41:24 (GMT) |
| commit | 3de035335255d553bdb344c32ffdb603816195d8 (patch) | |
| tree | 24896f5754301439fbfd4c280c71e46e5c830207 /src/huge.c | |
| parent | f70a254d44c8d30af2cd5d30531fb18fdabaae6d (diff) | |
| parent | 5271b673b2e93dd655fde6f2ee1ea849da5cb3d2 (diff) | |
| download | jemalloc-4.2.1.zip jemalloc-4.2.1.tar.gz jemalloc-4.2.1.tar.bz2 | |
Merge branch.4.2.1
Diffstat (limited to 'src/huge.c')
| -rw-r--r-- | src/huge.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -262,19 +262,19 @@ huge_ralloc_no_move_expand(tsdn_t *tsdn, void *ptr, size_t oldsize, malloc_mutex_unlock(tsdn, &arena->huge_mtx); /* - * Copy zero into is_zeroed_chunk and pass the copy to chunk_alloc(), so - * that it is possible to make correct junk/zero fill decisions below. + * Use is_zeroed_chunk to detect whether the trailing memory is zeroed, + * update extent's zeroed field, and zero as necessary. */ - is_zeroed_chunk = zero; - + is_zeroed_chunk = false; if (arena_chunk_ralloc_huge_expand(tsdn, arena, ptr, oldsize, usize, &is_zeroed_chunk)) return (true); malloc_mutex_lock(tsdn, &arena->huge_mtx); - /* Update the size of the huge allocation. */ huge_node_unset(ptr, node); extent_node_size_set(node, usize); + extent_node_zeroed_set(node, extent_node_zeroed_get(node) && + is_zeroed_chunk); huge_node_reset(tsdn, ptr, node); malloc_mutex_unlock(tsdn, &arena->huge_mtx); |
