Fixing bug 118933. Speeding up the id and name hash tables in nsHTMLDocument by changing them over from nsHashtable/nsStirngKey to pldhash. Also combining the hashes to optimize performance and memory useage. r=heikki@netscape.com, sr=jband@netscape.com.

git-svn-id: svn://10.0.0.236/trunk@112844 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%netscape.com
2002-01-25 06:37:35 +00:00
parent 6fdf561c89
commit 6b1260a9e6
7 changed files with 403 additions and 209 deletions

View File

@@ -224,9 +224,20 @@ NS_EXPORT nsresult
NS_NewImageDocument(nsIDocument** aInstancePtrResult)
{
nsImageDocument* doc = new nsImageDocument();
if(doc)
return doc->QueryInterface(NS_GET_IID(nsIDocument), (void**) aInstancePtrResult);
return NS_ERROR_OUT_OF_MEMORY;
NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);
nsresult rv = doc->Init();
if (NS_FAILED(rv)) {
delete doc;
return rv;
}
*aInstancePtrResult = doc;
NS_ADDREF(*aInstancePtrResult);
return NS_OK;
}
nsImageDocument::nsImageDocument()