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.
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -3697,22 +3697,20 @@ arena_ralloc_large(void* aPtr, size_t aS
static void*
arena_ralloc(void* aPtr, size_t aSize, size_t aOldSize, arena_t* aArena)
{
void* ret;
size_t copysize;
// 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;
}
} else if (aOldSize > gMaxBinClass && aOldSize <= gMaxLargeClass) {
MOZ_ASSERT(aSize > gMaxBinClass);
if (arena_ralloc_large(aPtr, aSize, aOldSize, aArena)) {
return aPtr;
}