diff --git a/js/src/jsdhash.c b/js/src/jsdhash.c index aa03b8446eb..4f1efd5498b 100644 --- a/js/src/jsdhash.c +++ b/js/src/jsdhash.c @@ -188,7 +188,7 @@ JS_DHashTableInit(JSDHashTable *table, JSDHashTableOps *ops, void *data, capacity = JS_DHASH_MIN_SIZE; log2 = JS_CeilingLog2(capacity); capacity = JS_BIT(log2); - if (capacity >= JS_DHASH_MAX_SIZE) + if (capacity >= JS_DHASH_SIZE_LIMIT) return JS_FALSE; table->hashShift = JS_DHASH_BITS - log2; table->maxAlphaFrac = 0xC0; /* 12/16 or .75 */ @@ -428,7 +428,7 @@ ChangeTable(JSDHashTable *table, int deltaLog2) newLog2 = oldLog2 + deltaLog2; oldCapacity = JS_BIT(oldLog2); newCapacity = JS_BIT(newLog2); - if (newCapacity >= JS_DHASH_MAX_SIZE) + if (newCapacity >= JS_DHASH_SIZE_LIMIT) return JS_FALSE; entrySize = table->entrySize; nbytes = newCapacity * entrySize; diff --git a/js/src/jsdhash.h b/js/src/jsdhash.h index 4852bae92db..8ca3abe4109 100644 --- a/js/src/jsdhash.h +++ b/js/src/jsdhash.h @@ -49,9 +49,9 @@ JS_BEGIN_EXTERN_C #define JS_DHASHMETER 1 #endif -/* Maximum table size, do not equal or exceed (see min&maxAlphaFrac, below). */ -#undef JS_DHASH_MAX_SIZE -#define JS_DHASH_MAX_SIZE JS_BIT(24) +/* Table size limit, do not equal or exceed (see min&maxAlphaFrac, below). */ +#undef JS_DHASH_SIZE_LIMIT +#define JS_DHASH_SIZE_LIMIT JS_BIT(24) /* Minimum table size, or gross entry count (net is at most .75 loaded). */ #ifndef JS_DHASH_MIN_SIZE diff --git a/xpcom/ds/pldhash.c b/xpcom/ds/pldhash.c index a34b45230b9..cfa216d4f23 100644 --- a/xpcom/ds/pldhash.c +++ b/xpcom/ds/pldhash.c @@ -189,7 +189,7 @@ PL_DHashTableInit(PLDHashTable *table, PLDHashTableOps *ops, void *data, capacity = PL_DHASH_MIN_SIZE; log2 = PR_CeilingLog2(capacity); capacity = PR_BIT(log2); - if (capacity >= PL_DHASH_MAX_SIZE) + if (capacity >= PL_DHASH_SIZE_LIMIT) return PR_FALSE; table->hashShift = PL_DHASH_BITS - log2; table->maxAlphaFrac = 0xC0; /* 12/16 or .75 */ @@ -429,7 +429,7 @@ ChangeTable(PLDHashTable *table, int deltaLog2) newLog2 = oldLog2 + deltaLog2; oldCapacity = PR_BIT(oldLog2); newCapacity = PR_BIT(newLog2); - if (newCapacity >= PL_DHASH_MAX_SIZE) + if (newCapacity >= PL_DHASH_SIZE_LIMIT) return PR_FALSE; entrySize = table->entrySize; nbytes = newCapacity * entrySize; diff --git a/xpcom/ds/pldhash.h b/xpcom/ds/pldhash.h index 637ece2c7a0..8a8c278fa4a 100644 --- a/xpcom/ds/pldhash.h +++ b/xpcom/ds/pldhash.h @@ -50,9 +50,9 @@ PR_BEGIN_EXTERN_C #define PL_DHASHMETER 1 #endif -/* Maximum table size, do not equal or exceed (see min&maxAlphaFrac, below). */ -#undef PL_DHASH_MAX_SIZE -#define PL_DHASH_MAX_SIZE PR_BIT(24) +/* Table size limit, do not equal or exceed (see min&maxAlphaFrac, below). */ +#undef PL_DHASH_SIZE_LIMIT +#define PL_DHASH_SIZE_LIMIT PR_BIT(24) /* Minimum table size, or gross entry count (net is at most .75 loaded). */ #ifndef PL_DHASH_MIN_SIZE