make lazy commit default; add commit check on segment allocation

This commit is contained in:
daan 2020-04-28 16:46:00 -07:00
parent 1b0de9b4cf
commit f86519bca6
2 changed files with 4 additions and 3 deletions

View file

@ -671,7 +671,8 @@ static mi_segment_t* mi_segment_init(mi_segment_t* segment, size_t required, mi_
if (!commit) {
// at least commit the info slices
mi_assert_internal(MI_COMMIT_SIZE > info_slices*MI_SEGMENT_SLICE_SIZE);
_mi_os_commit(segment, MI_COMMIT_SIZE, &is_zero, tld->stats);
bool ok = _mi_os_commit(segment, MI_COMMIT_SIZE, &is_zero, tld->stats);
if (!ok) return NULL; // failed to commit
}
segment->memid = memid;
segment->mem_is_fixed = mem_large;