Forgot to round capacity up to nearest power of two\! r=bienvenu.

git-svn-id: svn://10.0.0.236/trunk@77727 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org 2000-08-31 03:12:40 +00:00
parent 84b08eede7
commit 096321676e
2 changed files with 2 additions and 0 deletions

View File

@ -175,6 +175,7 @@ JS_DHashTableInit(JSDHashTable *table, JSDHashTableOps *ops, void *data,
if (capacity < JS_DHASH_MIN_SIZE)
capacity = JS_DHASH_MIN_SIZE;
log2 = JS_CeilingLog2(capacity);
capacity = JS_BIT(log2);
table->hashShift = JS_DHASH_BITS - log2;
table->sizeLog2 = log2;
table->sizeMask = JS_BITMASK(table->sizeLog2);

View File

@ -176,6 +176,7 @@ PL_DHashTableInit(PLDHashTable *table, PLDHashTableOps *ops, void *data,
if (capacity < PL_DHASH_MIN_SIZE)
capacity = PL_DHASH_MIN_SIZE;
log2 = PR_CeilingLog2(capacity);
capacity = PR_BIT(log2);
table->hashShift = PL_DHASH_BITS - log2;
table->sizeLog2 = log2;
table->sizeMask = PR_BITMASK(table->sizeLog2);