mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
can run basic test
This commit is contained in:
parent
fe5a314114
commit
bd5f7de3f4
6 changed files with 62 additions and 17 deletions
|
@ -274,7 +274,7 @@ void _mi_heap_page_reclaim(mi_heap_t* heap, mi_page_t* page)
|
|||
mi_page_set_heap(page,heap);
|
||||
_mi_page_free_collect(page, false); // ensure used count is up to date
|
||||
mi_page_queue_t* pq = mi_heap_page_queue_of(heap, page);
|
||||
mi_page_queue_push(heap, pq, page);
|
||||
mi_page_queue_push_at_end(heap, pq, page);
|
||||
mi_assert_expensive(_mi_page_is_valid(page));
|
||||
}
|
||||
|
||||
|
@ -807,8 +807,11 @@ static mi_page_t* mi_page_queue_find_free_ex(mi_heap_t* heap, mi_page_queue_t* p
|
|||
page_candidate = page;
|
||||
candidate_count = 0;
|
||||
}
|
||||
else if (/* !mi_page_is_expandable(page) && */ page->used >= page_candidate->used) {
|
||||
if (mi_page_all_free(page_candidate)) { _mi_page_free(page_candidate, pq); }
|
||||
else if (mi_page_all_free(page_candidate)) {
|
||||
_mi_page_free(page_candidate, pq);
|
||||
page_candidate = page;
|
||||
}
|
||||
else if (page->used >= page_candidate->used) {
|
||||
page_candidate = page;
|
||||
}
|
||||
// if we find a non-expandable candidate, or searched for N pages, return with the best candidate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue