mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
merge from dev
This commit is contained in:
commit
e5a3f3d7c4
1 changed files with 1 additions and 1 deletions
|
@ -656,7 +656,7 @@ static mi_segment_t* mi_segment_init(mi_segment_t* segment, size_t required, mi_
|
||||||
const size_t segment_size = segment_slices * MI_SEGMENT_SLICE_SIZE;
|
const size_t segment_size = segment_slices * MI_SEGMENT_SLICE_SIZE;
|
||||||
|
|
||||||
// Commit eagerly only if not the first N lazy segments (to reduce impact of many threads that allocate just a little)
|
// Commit eagerly only if not the first N lazy segments (to reduce impact of many threads that allocate just a little)
|
||||||
const bool eager_delay = (tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay));
|
const bool eager_delay = (!_mi_is_main_thread() && tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay));
|
||||||
const bool eager = !eager_delay && mi_option_is_enabled(mi_option_eager_commit);
|
const bool eager = !eager_delay && mi_option_is_enabled(mi_option_eager_commit);
|
||||||
bool commit = eager || (required > 0);
|
bool commit = eager || (required > 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue