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:
parent
84b08eede7
commit
096321676e
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user