diff options
author | 2016-01-01 23:42:47 +0100 | |
---|---|---|
committer | 2016-01-01 23:42:47 +0100 | |
commit | 53d109a21d97d073bc6a1f36a6c39b940a55eb69 (patch) | |
tree | 4bc3839c108e9964a7aa3fa5a3f88760e1cf17ae | |
parent | c671a5cb30db29feda56f008d45789c2fd4928e9 (diff) |
Remove unused hashconsing code.
-rw-r--r-- | lib/hashcons.ml | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/hashcons.ml b/lib/hashcons.ml index 46ba0b628..d92751918 100644 --- a/lib/hashcons.ml +++ b/lib/hashcons.ml @@ -96,20 +96,6 @@ let recursive_hcons h f u = let () = loop := hrec in hrec -(* A set of global hashcons functions *) -let hashcons_resets = ref [] -let init() = List.iter (fun f -> f()) !hashcons_resets - -(* [register_hcons h u] registers the hcons function h, result of the above - * wrappers. It returns another hcons function that always uses the same - * table, which can be reinitialized by init() - *) -let register_hcons h u = - let hf = ref (h u) in - let reset() = hf := h u in - hashcons_resets := reset :: !hashcons_resets; - (fun x -> !hf x) - (* Basic hashcons modules for string and obj. Integers do not need be hashconsed. *) @@ -194,18 +180,3 @@ module Hobj = Make( let equal = comp_obj let hash = Hashtbl.hash end) - -(* Hashconsing functions for string and obj. Always use the same - * global tables. The latter can be reinitialized with init() - *) -(* string : string -> string *) -(* obj : Obj.t -> Obj.t *) -let string = register_hcons (simple_hcons Hstring.generate Hstring.hcons) () -let obj = register_hcons (recursive_hcons Hobj.generate Hobj.hcons) () - -(* The unsafe polymorphic hashconsing function *) -let magic_hash (c : 'a) = - init(); - let r = obj (Obj.repr c) in - init(); - (Obj.magic r : 'a) |