mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 05:14:24 +00:00
Bug 1413096 - Remove unnecessary call to ffs. r=njn
Comparing ffs(x) == ffs(y), when x and y are guaranteed to be powers of 2 (or 0, or 1), is the same as x == y. --HG-- extra : rebase_source : d6cc3399d85fa9fda2559435e99adbfb82ac8da0
This commit is contained in:
parent
3c71490814
commit
331ef2d1a6
@ -3680,8 +3680,8 @@ arena_ralloc(void* aPtr, size_t aSize, size_t aOldSize, arena_t* aArena)
|
||||
// Try to avoid moving the allocation.
|
||||
if (aSize < small_min) {
|
||||
if (aOldSize < small_min &&
|
||||
ffs((int)(RoundUpPow2(aSize) >> (TINY_MIN_2POW + 1))) ==
|
||||
ffs((int)(RoundUpPow2(aOldSize) >> (TINY_MIN_2POW + 1)))) {
|
||||
(RoundUpPow2(aSize) >> (TINY_MIN_2POW + 1) ==
|
||||
RoundUpPow2(aOldSize) >> (TINY_MIN_2POW + 1))) {
|
||||
goto IN_PLACE; // Same size class.
|
||||
}
|
||||
} else if (aSize <= small_max) {
|
||||
|
Loading…
Reference in New Issue
Block a user