chiark / gitweb /
Add global unihash table; use universal hashing instead of CRC.
[mLib] / atom.c
diff --git a/atom.c b/atom.c
index dd02f5457b656919995052b037cf6f5de79b5e65..768d229a6bcd9a388a64583c05f603071147367d 100644 (file)
--- a/atom.c
+++ b/atom.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: atom.c,v 1.3 2001/01/25 21:13:15 mdw Exp $
+ * $Id: atom.c,v 1.4 2003/12/15 20:53:47 mdw Exp $
  *
  * Atom management
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: atom.c,v $
+ * Revision 1.4  2003/12/15 20:53:47  mdw
+ * Add global unihash table; use universal hashing instead of CRC.
+ *
  * Revision 1.3  2001/01/25 21:13:15  mdw
  * New function allowing an atom's length to be specified at intern time.
  *
@@ -48,9 +51,9 @@
 
 #include "alloc.h"
 #include "atom.h"
-#include "crc32.h"
 #include "hash.h"
 #include "sym.h"
+#include "unihash.h"
 
 /*----- Static variables --------------------------------------------------*/
 
@@ -168,7 +171,7 @@ atom *atom_gensym(atom_table *t)
   a->b.name = (char *)(a + 1);
   memcpy(a->b.name, buf, sz);
   a->b.len = sz;
-  CRC32(a->b.b.hash, 0, buf, sz);
+  a->b.b.hash = UNIHASH(&unihash_global, buf, sz);
   a->f = ATOMF_GENSYM;
   a->b.b.next = t->g;
   t->g = &a->b.b;