зеркало из https://github.com/mozilla/gecko-dev.git
Bump up the intial hash table size in a bunch of places to avoid resizing the hash later. r=scc
This commit is contained in:
Родитель
87e19c9cef
Коммит
466c068544
|
@ -111,7 +111,7 @@ nsGenericModule::nsGenericModule(const char* moduleName, PRUint32 componentCount
|
|||
mModuleName(moduleName),
|
||||
mComponentCount(componentCount),
|
||||
mComponents(components),
|
||||
mFactories(8, PR_FALSE),
|
||||
mFactories(32, PR_FALSE),
|
||||
mDtor(dtor)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
|
|
@ -148,7 +148,7 @@ NS_COM nsIAtom* NS_NewAtom(const PRUnichar* us)
|
|||
// Note: in a low memory condition, this routine could return |NULL|
|
||||
{
|
||||
if (nsnull == gAtomHashTable) {
|
||||
gAtomHashTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
|
||||
gAtomHashTable = PL_NewHashTable(2048, (PLHashFunction) HashKey,
|
||||
(PLHashComparator) CompareKeys,
|
||||
(PLHashComparator) nsnull,
|
||||
nsnull, nsnull);
|
||||
|
@ -166,7 +166,7 @@ NS_COM nsIAtom* NS_NewAtom(const PRUnichar* us)
|
|||
AtomImpl* id = new(us, uslen) AtomImpl();
|
||||
if ( id )
|
||||
{
|
||||
PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id);
|
||||
PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id);
|
||||
NS_ADDREF(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ nsPersistentProperties::nsPersistentProperties()
|
|||
|
||||
mIn = nsnull;
|
||||
mSubclass = NS_STATIC_CAST(nsIPersistentProperties*, this);
|
||||
mTable = PL_NewHashTable(8, (PLHashFunction) HashKey,
|
||||
mTable = PL_NewHashTable(128, (PLHashFunction) HashKey,
|
||||
(PLHashComparator) CompareKeys,
|
||||
(PLHashComparator) nsnull, nsnull, nsnull);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ nsGenericModule::nsGenericModule(const char* moduleName, PRUint32 componentCount
|
|||
mModuleName(moduleName),
|
||||
mComponentCount(componentCount),
|
||||
mComponents(components),
|
||||
mFactories(8, PR_FALSE),
|
||||
mFactories(32, PR_FALSE),
|
||||
mDtor(dtor)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
|
|
|
@ -265,7 +265,7 @@ nsInterfaceInfoManager::indexify_file(const nsFileSpec *fileSpec)
|
|||
}
|
||||
|
||||
// as many InterfaceDirectoryEntries as we expect to see.
|
||||
#define XPT_HASHSIZE 64
|
||||
#define XPT_HASHSIZE 512
|
||||
|
||||
#ifdef DEBUG_iim
|
||||
static PRIntn
|
||||
|
|
|
@ -92,7 +92,7 @@ typedef struct XPTHashRecord {
|
|||
struct XPTHashRecord *next;
|
||||
} XPTHashRecord;
|
||||
|
||||
#define XPT_HASHSIZE 32
|
||||
#define XPT_HASHSIZE 512
|
||||
|
||||
struct XPTHashTable { /* it's already typedef'ed from before. */
|
||||
XPTHashRecord *buckets[XPT_HASHSIZE];
|
||||
|
|
Загрузка…
Ссылка в новой задаче