Let opt.zero propagate to core allocation.

I.e. set dopts->zero early on if opt.zero is true, rather than leaving it set by
the entry-point function (malloc, calloc, etc.) and then memsetting.  This
avoids situations where we zero once in the large-alloc pathway and then again
via memset.
This commit is contained in:
David Goldblatt
2020-04-29 09:05:57 -07:00
committed by David Goldblatt
parent 2c09d43494
commit f1f8a75496
2 changed files with 23 additions and 27 deletions

View File

@@ -32,9 +32,6 @@ large_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment,
return NULL;
}
if (config_fill && unlikely(opt_zero)) {
zero = true;
}
if (likely(!tsdn_null(tsdn))) {
arena = arena_choose_maybe_huge(tsdn_tsd(tsdn), arena, usize);
}