mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 23:19:31 +03:00
fix absorb heap (issue #132)
This commit is contained in:
parent
770e752578
commit
b46bacc180
1 changed files with 3 additions and 3 deletions
|
@ -303,14 +303,14 @@ static void mi_heap_absorb(mi_heap_t* heap, mi_heap_t* from) {
|
||||||
mi_assert_internal(heap!=NULL);
|
mi_assert_internal(heap!=NULL);
|
||||||
if (from==NULL || from->page_count == 0) return;
|
if (from==NULL || from->page_count == 0) return;
|
||||||
|
|
||||||
// unfull all full pages
|
// unfull all full pages in the `from` heap
|
||||||
mi_page_t* page = heap->pages[MI_BIN_FULL].first;
|
mi_page_t* page = from->pages[MI_BIN_FULL].first;
|
||||||
while (page != NULL) {
|
while (page != NULL) {
|
||||||
mi_page_t* next = page->next;
|
mi_page_t* next = page->next;
|
||||||
_mi_page_unfull(page);
|
_mi_page_unfull(page);
|
||||||
page = next;
|
page = next;
|
||||||
}
|
}
|
||||||
mi_assert_internal(heap->pages[MI_BIN_FULL].first == NULL);
|
mi_assert_internal(from->pages[MI_BIN_FULL].first == NULL);
|
||||||
|
|
||||||
// free outstanding thread delayed free blocks
|
// free outstanding thread delayed free blocks
|
||||||
_mi_heap_delayed_free(from);
|
_mi_heap_delayed_free(from);
|
||||||
|
|
Loading…
Add table
Reference in a new issue