mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-09 12:58:41 +03:00
Use bitwise operation to divide constant
This commit is contained in:
parent
1125271c27
commit
73cddd53d7
4 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue