- if (t->c)
- t->c--;
- if (!t->c) {
- uint32 m = t->mask + 1;
- sym_base *p, *q, *r;
- size_t i, lim;
-
- TRACK_CTX("symbol table extension");
- TRACK_PUSH;
-
- /* --- Update values in the anchor block --- */
-
- TRY {
- t->a = xrealloc(t->a, (t->mask + 1) * 2 * sizeof(sym_base *));
- } CATCH switch (exc_type) {
- case EXC_NOMEM:
- TRACK_POP;
- return (bin->next);
- default:
- TRACK_POP;
- RETHROW;
- } END_TRY;
-
- t->c = SYM_LIMIT(t->mask + 1);
- t->mask = (t->mask + 1) * 2 - 1;
-
- /* --- Now wander through the table rehashing things --- *
- *
- * This loop is very careful to avoid problems with aliasing. The items
- * are dealt with from the end backwards to avoid overwriting bins before
- * they've been processed.
- */
-
- lim = (t->mask + 1) >> 1;
- for (i = 0; i < lim; i++) {
-
- /* --- Some initialization --- */
-
- r = t->a[i];
- p = (sym_base *)(t->a + i);
- q = (sym_base *)(t->a + i + lim);
-
- /* --- Now go through the @r@ list --- */
-
- while (r) {
- if (r->hash & m)
- q = q->next = r;
- else
- p = p->next = r;
- r = r->next;
- }
- p->next = q->next = 0;
- }
-
- TRACK_POP;
- }