- assert (string != NULL);
-
- if (!initialized)
- {
- initialized = true;
- atexit (free_all_atoms);
- }
-
- hash = hash_string (string, 0);
- HMAP_FOR_EACH_WITH_HASH (atom, struct atom, node, hash, &atoms)
- if (!strcmp (atom->string, string))
- {
- atom->ref_count++;
- return atom;
- }
-
- atom = xmalloc (sizeof *atom);
- atom->string = xstrdup (string);
- atom->ref_count = 1;
- hmap_insert (&atoms, &atom->node, hash);
- return atom;
-}
-
-/* Destroys ATOM. */
-static void
-atom_destroy (struct atom *atom)
-{
- if (atom != NULL)
- {
- assert (atom->ref_count > 0);
- atom->ref_count--;
- if (atom->ref_count == 0)
- {
- hmap_delete (&atoms, &atom->node);
- free_atom (atom);
- }
- }
+ hash = hash_int (val_labs_count (vls), basis);
+ HMAP_FOR_EACH (label, struct val_lab, node, &vls->labels)
+ hash ^= value_hash (&label->value, vls->width,
+ hash_string (label->label, basis));
+ return hash;