Bug 414894 - Remove content arena. r=smaug, sr=sicking, a=schrep

This commit is contained in:
2008-02-02 15:41:24 -08:00
parent 5984d05442
commit 53eec62d4c
42 changed files with 160 additions and 462 deletions

View File

@@ -171,44 +171,8 @@ nsINode::nsSlots::~nsSlots()
}
}
void*
nsINode::nsSlots::operator new(size_t aSize, nsDOMNodeAllocator* aAllocator)
{
void* result = aAllocator->Alloc(aSize);
if (result) {
NS_ADDREF(aAllocator);
}
return result;
}
void
nsINode::nsSlots::operator delete(void* aPtr, size_t aSize)
{
size_t* szPtr = static_cast<size_t*>(aPtr);
*szPtr = aSize;
}
//----------------------------------------------------------------------
void*
nsINode::operator new(size_t aSize, nsINodeInfo* aNodeInfo)
{
nsDOMNodeAllocator* allocator =
aNodeInfo->NodeInfoManager()->NodeAllocator();
void* result = allocator->Alloc(aSize);
if (result) {
NS_ADDREF(allocator);
}
return result;
}
void
nsINode::operator delete(void* aPtr, size_t aSize)
{
size_t* szPtr = static_cast<size_t*>(aPtr);
*szPtr = aSize;
}
nsINode::~nsINode()
{
NS_ASSERTION(!HasSlots(), "nsNodeUtils::LastRelease was not called?");
@@ -312,7 +276,7 @@ nsGenericElement::GetSystemEventGroup(nsIDOMEventGroup** aGroup)
nsINode::nsSlots*
nsINode::CreateSlots()
{
return new (GetAllocator()) nsSlots(mFlagsOrSlots);
return new nsSlots(mFlagsOrSlots);
}
void
@@ -1158,8 +1122,7 @@ nsGenericElement::nsDOMSlots::~nsDOMSlots()
}
nsGenericElement::nsGenericElement(nsINodeInfo *aNodeInfo)
: nsIContent(aNodeInfo),
mAttrsAndChildren(aNodeInfo->NodeInfoManager()->NodeAllocator())
: nsIContent(aNodeInfo)
{
// Set the default scriptID to JS - but skip SetScriptTypeID as it
// does extra work we know isn't necessary here...
@@ -4218,7 +4181,7 @@ nsGenericElement::IndexOf(nsINode* aPossibleChild) const
nsINode::nsSlots*
nsGenericElement::CreateSlots()
{
return new (GetAllocator()) nsDOMSlots(mFlagsOrSlots);
return new nsDOMSlots(mFlagsOrSlots);
}
PRBool