Bug 856368 - Remove DEBUG_TRACEMALLOC_PRESARENA. r=roc

This commit is contained in:
Mats Palmgren 2013-04-15 22:00:06 +02:00
parent c0b436c32d
commit 702d0070af
3 changed files with 3 additions and 47 deletions

View File

@ -228,7 +228,7 @@ public:
#ifdef DEBUG
mPresArenaAllocCount--;
#endif
if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying)
if (!mIsDestroying)
mFrameArena.FreeByFrameID(aID, aPtr);
}
@ -253,7 +253,7 @@ public:
#ifdef DEBUG
mPresArenaAllocCount--;
#endif
if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying)
if (!mIsDestroying)
mFrameArena.FreeByObjectID(aID, aPtr);
}
@ -279,7 +279,7 @@ public:
#ifdef DEBUG
mPresArenaAllocCount--;
#endif
if (PRESARENA_MUST_FREE_DURING_DESTROY || !mIsDestroying)
if (!mIsDestroying)
mFrameArena.FreeBySize(aSize, aPtr);
}

View File

@ -239,8 +239,6 @@ ARENA_POISON_init()
return PR_SUCCESS;
}
#ifndef DEBUG_TRACEMALLOC_PRESARENA
// All keys to this hash table fit in 32 bits (see below) so we do not
// bother actually hashing them.
@ -467,36 +465,6 @@ nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun aMallocSizeOf,
mState->SizeOfIncludingThis(aMallocSizeOf, aArenaStats);
}
#else
// Stub implementation that forwards everything to malloc and does not
// poison allocations (it still initializes the poison value though,
// for external use through GetPoisonValue()).
struct nsPresArena::State
{
State()
{
PR_CallOnce(&ARENA_POISON_guard, ARENA_POISON_init);
}
void* Allocate(uint32_t /* unused */, size_t aSize)
{
return moz_malloc(aSize);
}
void Free(uint32_t /* unused */, void* aPtr)
{
moz_free(aPtr);
}
};
void
nsPresArena::SizeOfExcludingThis(nsMallocSizeOfFun, nsArenaMemoryStats*)
{}
#endif // DEBUG_TRACEMALLOC_PRESARENA
// Public interface
nsPresArena::nsPresArena()
: mState(new nsPresArena::State())

View File

@ -15,18 +15,6 @@
struct nsArenaMemoryStats;
// Uncomment this to disable arenas, instead forwarding to
// malloc for every allocation.
//#define DEBUG_TRACEMALLOC_PRESARENA 1
// The debugging version of nsPresArena does not free all the memory it
// allocated when the arena itself is destroyed.
#ifdef DEBUG_TRACEMALLOC_PRESARENA
#define PRESARENA_MUST_FREE_DURING_DESTROY true
#else
#define PRESARENA_MUST_FREE_DURING_DESTROY false
#endif
class nsPresArena {
public:
nsPresArena();