mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
remove on-demand page commit option
This commit is contained in:
parent
d8b0a9dc24
commit
5cfdc39ff1
3 changed files with 13 additions and 32 deletions
|
@ -570,7 +570,8 @@ static void mi_page_extend_free(mi_heap_t* heap, mi_page_t* page, mi_tld_t* tld)
|
|||
if (page->capacity >= page->reserved) return;
|
||||
|
||||
size_t page_size;
|
||||
uint8_t* page_start = _mi_page_start(_mi_page_segment(page), page, &page_size);
|
||||
//uint8_t* page_start =
|
||||
_mi_page_start(_mi_page_segment(page), page, &page_size);
|
||||
mi_stat_counter_increase(tld->stats.pages_extended, 1);
|
||||
|
||||
// calculate the extend count
|
||||
|
@ -588,12 +589,6 @@ static void mi_page_extend_free(mi_heap_t* heap, mi_page_t* page, mi_tld_t* tld)
|
|||
mi_assert_internal(extend > 0 && extend + page->capacity <= page->reserved);
|
||||
mi_assert_internal(extend < (1UL<<16));
|
||||
|
||||
// commit on-demand for large and huge pages?
|
||||
if (_mi_page_segment(page)->page_kind >= MI_PAGE_LARGE && !mi_option_is_enabled(mi_option_eager_page_commit)) {
|
||||
uint8_t* start = page_start + (page->capacity * bsize);
|
||||
_mi_mem_commit(start, extend * bsize, NULL, &tld->os);
|
||||
}
|
||||
|
||||
// and append the extend the free list
|
||||
if (extend < MI_MIN_SLICES || MI_SECURE==0) { //!mi_option_is_enabled(mi_option_secure)) {
|
||||
mi_page_free_list_extend(page, bsize, extend, &tld->stats );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue