chiark / gitweb /
struct/sym.c: Fix loading following table extension.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 18 Jul 2024 15:09:18 +0000 (16:09 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 18 Jul 2024 15:09:18 +0000 (16:09 +0100)
The calculation should be based on the previous size, because we've
already spent half of the tokens getting to this point.

struct/sym.c

index 25e297af93dde6ffc7fc18164468e637839e300e..4eca8916ef09b91bc88d2a140f80b9f216dc840a 100644 (file)
@@ -179,7 +179,7 @@ void *sym_find(sym_table *t, const char *n, long l, size_t sz, unsigned *f)
   if (t->load)
     t->load--;
   if (!t->load && hash_extend(&t->t))
-    t->load = SYM_LIMIT(t->t.mask + 1);
+    t->load = SYM_LIMIT(t->t.mask/2 + 1);
 
   /* --- Finished that, so return the new symbol block --- */