fuse used decrement with test for slightly better codegen

This commit is contained in:
daan 2020-09-24 16:28:25 -07:00
parent abcaa4a4f2
commit 44d030ba9d

View File

@ -448,8 +448,7 @@ void mi_free(void* p) mi_attr_noexcept
#endif
mi_block_set_next(page, block, page->local_free);
page->local_free = block;
page->used--;
if (mi_unlikely(mi_page_all_free(page))) {
if (mi_unlikely(--page->used == 0)) { // using this expression generates better code than: page->used--; if (mi_page_all_free(page))
_mi_page_retire(page);
}
}