Use bitwise operation to divide constant

This commit is contained in:
YangHau 2019-07-08 15:32:28 +08:00
parent 1125271c27
commit 73cddd53d7
4 changed files with 4 additions and 4 deletions

View file

@ -243,7 +243,7 @@ static inline bool mi_page_all_used(mi_page_t* page) {
// is more than 7/8th of a page in use?
static inline bool mi_page_mostly_used(const mi_page_t* page) {
if (page==NULL) return true;
uint16_t frac = page->reserved / 8U;
uint16_t frac = page->reserved >> 3;
return (page->reserved - page->used + page->thread_freed < frac);
}