From b12466ef14d4bdf13af9c2f772c692ee1760da2d Mon Sep 17 00:00:00 2001 From: ppedrot Date: Wed, 26 Sep 2012 20:38:55 +0000 Subject: Reusing the Hashset data structure in Hashcons. Hopefully, this should not disrupt anything... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15836 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/term.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kernel/term.ml') diff --git a/kernel/term.ml b/kernel/term.ml index 8ab04af24..42309c37e 100644 --- a/kernel/term.ml +++ b/kernel/term.ml @@ -1236,7 +1236,10 @@ let equals_constr t1 t2 = (** Note that the following Make has the side effect of creating once and for all the table we'll use for hash-consing all constr *) -module H = Hashset.Make(struct type t = constr let equal = equals_constr end) +module HashsetTerm = Hashset.Make(struct type t = constr let equal = equals_constr end) + +let term_table = HashsetTerm.create 19991 +(* The associative table to hashcons terms. *) open Hashset.Combine @@ -1320,7 +1323,7 @@ let hcons_term (sh_sort,sh_ci,sh_construct,sh_ind,sh_con,sh_na,sh_id) = let (y, h) = hash_term t in (* [h] must be positive. *) let h = h land 0x3FFFFFFF in - (H.may_add_and_get h y, h) + (HashsetTerm.repr h y term_table, h) in (* Make sure our statically allocated Rels (1 to 16) are considered -- cgit v1.2.3