diff options
| author | letouzey | 2011-09-22 19:08:47 +0000 |
|---|---|---|
| committer | letouzey | 2011-09-22 19:08:47 +0000 |
| commit | 2c968766b5bb57041694782ae2ffcda82ea5fe38 (patch) | |
| tree | 1dc8e1646926bea3609c8b0a5f5724019defa5a7 | |
| parent | e15d40ac526eeac7c725e4defc2ddb9dde56212a (diff) | |
Hash-consing: attempt to stop hash-consing separately constr in declare.ml
Now that Yann has provided a better hashing mechanism for constr,
it might be interesting to (re-?)activate a global hash-consing of
constr. Earlier, specific hash-cons tables were created at each call
to hcons_constant_declaration. According to Hugo, this was meant to
avoid blow-up in at least contrib Pocklington. This contrib seems
to behave nicely now with global hashconsing (thanks Yann ;-).
We'll see tomorrow what impact this has on other contribs.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14487 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | kernel/names.ml | 2 | ||||
| -rw-r--r-- | kernel/names.mli | 2 | ||||
| -rw-r--r-- | kernel/term.ml | 2 | ||||
| -rw-r--r-- | kernel/univ.ml | 6 | ||||
| -rw-r--r-- | library/declare.ml | 1 |
5 files changed, 4 insertions, 9 deletions
diff --git a/kernel/names.ml b/kernel/names.ml index c85389434f..d926779430 100644 --- a/kernel/names.ml +++ b/kernel/names.ml @@ -389,7 +389,7 @@ module Hcn = Hashcons.Make( let hash x = Hashtbl.hash (fst x) end) -let hcons_names () = +let hcons_names = let hstring = Hashcons.simple_hcons Hashcons.Hstring.f () in let hident = hstring in let hname = Hashcons.simple_hcons Hname.f hident in diff --git a/kernel/names.mli b/kernel/names.mli index 8a2e892ef2..38fcebafa5 100644 --- a/kernel/names.mli +++ b/kernel/names.mli @@ -197,7 +197,7 @@ val eq_egr : evaluable_global_reference -> evaluable_global_reference -> bool (** Hash-consing *) -val hcons_names : unit -> +val hcons_names : (constant -> constant) * (mutual_inductive -> mutual_inductive) * (dir_path -> dir_path) * (name -> name) * (identifier -> identifier) diff --git a/kernel/term.ml b/kernel/term.ml index 3281154202..4c6c8e3388 100644 --- a/kernel/term.ml +++ b/kernel/term.ml @@ -1407,7 +1407,7 @@ let hcons_constr (hcon,hkn,hdir,hname,hident) = let htcci = Hashcons.simple_hcons Htype.f (hcci,hsortscci) in (hcci,htcci) -let (hcons1_constr, hcons1_types) = hcons_constr (hcons_names()) +let (hcons1_constr, hcons1_types) = hcons_constr hcons_names (*******) diff --git a/kernel/univ.ml b/kernel/univ.ml index c68021a209..ba14771aab 100644 --- a/kernel/univ.ml +++ b/kernel/univ.ml @@ -859,11 +859,7 @@ module Huniv = end) let hcons1_univlevel = - (* Beware: it is important to run the next line at launch-time - since it creates internal hash-tables. - We could/should probably share the other calls to [hcons_names] - in Term and Declare *) - let _,_,hdir,_,_ = Names.hcons_names() in + let _,_,hdir,_,_ = Names.hcons_names in Hashcons.simple_hcons Hunivlevel.f hdir let hcons1_univ = Hashcons.simple_hcons Huniv.f hcons1_univlevel diff --git a/library/declare.ml b/library/declare.ml index c566cedfd1..df87153de8 100644 --- a/library/declare.ml +++ b/library/declare.ml @@ -156,7 +156,6 @@ let inConstant = let hcons_constant_declaration = function | DefinitionEntry ce when !Flags.hash_cons_proofs -> - let (hcons1_constr,_) = hcons_constr (hcons_names()) in DefinitionEntry { const_entry_body = hcons1_constr ce.const_entry_body; const_entry_type = Option.map hcons1_constr ce.const_entry_type; |
