Bug 1511251 - Remove redundant and costly assert. r=njn

The diagnostic assert (so fortunately, it doesn't impact release builds)
as added in bug 1405159, but is costly because it uses the modulus of
the division with a variable integer, which is a slow operation.
However, in arena_run_reg_dalloc, we end up doing the same diagnostic
assert, in a different form: after performing the division in a faster
manner, we assert that the result, multiplied by the diviser, returns
the original number.

Differential Revision: https://phabricator.services.mozilla.com/D13501

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2018-12-05 14:45:52 +00:00
parent 27230a9848
commit a8d4234310

View File

@ -3228,10 +3228,6 @@ void arena_t::DallocSmall(arena_chunk_t* aChunk, void* aPtr,
size = bin->mSizeClass;
MOZ_DIAGNOSTIC_ASSERT(uintptr_t(aPtr) >=
uintptr_t(run) + bin->mRunFirstRegionOffset);
MOZ_DIAGNOSTIC_ASSERT(
(uintptr_t(aPtr) - (uintptr_t(run) + bin->mRunFirstRegionOffset)) %
size ==
0);
memset(aPtr, kAllocPoison, size);