Bug 1418153 - Remove impossible condition. r=njn

Since the old size arena_ralloc is given is already a size class, when
the size class for the new size is the same as the old size, the new
size can't be larger than the old size, so there's never anything to
zero.

--HG--
extra : rebase_source : dd468de60b2ed87718ec4e26f13d3b0c8932f455
This commit is contained in:
Mike Hommey 2017-11-16 15:35:37 +09:00
Родитель b73d32f806
Коммит ef84807f38
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -3702,12 +3702,10 @@ arena_ralloc(void* aPtr, size_t aSize, size_t aOldSize, arena_t* aArena)
// Try to avoid moving the allocation.
if (aSize <= gMaxBinClass) {
if (aOldSize <= gMaxBinClass && SizeClass(aSize) == SizeClass(aOldSize)) {
if (aOldSize <= gMaxBinClass && SizeClass(aSize).Size() == aOldSize) {
if (aSize < aOldSize) {
memset(
(void*)(uintptr_t(aPtr) + aSize), kAllocPoison, aOldSize - aSize);
} else if (opt_zero && aSize > aOldSize) {
memset((void*)(uintptr_t(aPtr) + aOldSize), 0, aSize - aOldSize);
}
return aPtr;
}