Lines Matching defs:table

222    to the hash table size, which is a power of 2. We use double-hashing,
224 of the first hash value that were discarded (masked out) when the table
225 index was calculated: index = hash & mask, where mask = table->size - 1.
226 We limit the maximum step size to table->size / 4 (mask >> 2) and make
523 static NAMED *lookup(XML_Parser parser, HASH_TABLE *table, KEY name,
1298 to worry which hash secrets each table has.
1342 to worry which hash secrets each table has.
3471 int j; /* hash table index */
3481 /* size of hash table must be at least 2 * (# of prefixed attributes) */
3485 /* hash table size must also be a power of 2 and >= 8 */
3520 version = 0; /* force re-initialization of m_nsAtts hash table */
3549 * has to have passed through the hash table lookup once
3586 { /* Check hash table for duplicate of expanded name (uriName).
3587 Derived from code in lookup(parser, HASH_TABLE *table, ...).
3591 j = uriHash & mask; /* index into hash table */
4834 * inserted into the hash table at the start of the
5399 * table is the external subset name "#" which cannot be
6820 /* Copy the prefix table. */
6837 /* Copy the attribute id table. */
6868 /* Copy the element type table. */
7040 lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
7042 if (table->size == 0) {
7046 table->power = INIT_POWER;
7047 /* table->size is a power of 2 */
7048 table->size = (size_t)1 << INIT_POWER;
7049 tsize = table->size * sizeof(NAMED *);
7050 table->v = table->mem->malloc_fcn(tsize);
7051 if (! table->v) {
7052 table->size = 0;
7055 memset(table->v, 0, tsize);
7056 i = hash(parser, name) & ((unsigned long)table->size - 1);
7059 unsigned long mask = (unsigned long)table->size - 1;
7062 while (table->v[i]) {
7063 if (keyeq(name, table->v[i]->name))
7064 return table->v[i];
7066 step = PROBE_STEP(h, mask, table->power);
7067 i < step ? (i += table->size - step) : (i -= step);
7072 /* check for overflow (table is half full) */
7073 if (table->used >> (table->power - 1)) {
7074 unsigned char newPower = table->power + 1;
7090 NAMED **newV = table->mem->malloc_fcn(tsize);
7094 for (i = 0; i < table->size; i++)
7095 if (table->v[i]) {
7096 unsigned long newHash = hash(parser, table->v[i]->name);
7104 newV[j] = table->v[i];
7106 table->mem->free_fcn(table->v);
7107 table->v = newV;
7108 table->power = newPower;
7109 table->size = newSize;
7112 while (table->v[i]) {
7119 table->v[i] = table->mem->malloc_fcn(createSize);
7120 if (! table->v[i])
7122 memset(table->v[i], 0, createSize);
7123 table->v[i]->name = name;
7124 (table->used)++;
7125 return table->v[i];
7129 hashTableClear(HASH_TABLE *table) {
7131 for (i = 0; i < table->size; i++) {
7132 table->mem->free_fcn(table->v[i]);
7133 table->v[i] = NULL;
7135 table->used = 0;
7139 hashTableDestroy(HASH_TABLE *table) {
7141 for (i = 0; i < table->size; i++)
7142 table->mem->free_fcn(table->v[i]);
7143 table->mem->free_fcn(table->v);
7156 hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) {
7157 iter->p = table->v;
7158 iter->end = iter->p ? iter->p + table->size : NULL;