mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
allow allocation in committed regions even if not requested
This commit is contained in:
parent
93a6463383
commit
534e1e39ef
3 changed files with 7 additions and 7 deletions
|
@ -327,12 +327,14 @@ static mi_segment_t* mi_segment_alloc(size_t required, mi_page_kind_t page_kind,
|
|||
mi_assert_internal(segment_size >= required);
|
||||
size_t page_size = (page_kind == MI_PAGE_HUGE ? segment_size : (size_t)1 << page_shift);
|
||||
|
||||
// Try to get it from our thread local cache first
|
||||
// Initialize parameters
|
||||
bool eager_delayed = (page_kind <= MI_PAGE_MEDIUM && tld->count < (size_t)mi_option_get(mi_option_eager_commit_delay));
|
||||
bool eager = !eager_delayed && mi_option_is_enabled(mi_option_eager_commit);
|
||||
bool commit = eager || (page_kind >= MI_PAGE_LARGE);
|
||||
bool protection_still_good = false;
|
||||
bool is_zero = false;
|
||||
|
||||
// Try to get it from our thread local cache first
|
||||
mi_segment_t* segment = mi_segment_cache_pop(segment_size, tld);
|
||||
if (segment != NULL) {
|
||||
if (MI_SECURE!=0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue