mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-08 16:29:31 +03:00
fuse used decrement with test for slightly better codegen
This commit is contained in:
parent
abcaa4a4f2
commit
44d030ba9d
1 changed files with 1 additions and 2 deletions
|
@ -448,8 +448,7 @@ void mi_free(void* p) mi_attr_noexcept
|
||||||
#endif
|
#endif
|
||||||
mi_block_set_next(page, block, page->local_free);
|
mi_block_set_next(page, block, page->local_free);
|
||||||
page->local_free = block;
|
page->local_free = block;
|
||||||
page->used--;
|
if (mi_unlikely(--page->used == 0)) { // using this expression generates better code than: page->used--; if (mi_page_all_free(page))
|
||||||
if (mi_unlikely(mi_page_all_free(page))) {
|
|
||||||
_mi_page_retire(page);
|
_mi_page_retire(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue