From 278517722988d040cb8da822e319d723670ac519 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Mon, 29 Oct 2012 13:02:23 +0000 Subject: Removed many calls to OCaml generic equality. This was done by writing our own comparison functions, and enforcing monomorphization in many places. This should be more efficient, btw. Still a work in progress. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15932 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/util.ml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/util.ml') diff --git a/lib/util.ml b/lib/util.ml index af3b13fa7d..6a0ba470a9 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -137,9 +137,14 @@ let subst_command_placeholder s t = done; Buffer.contents buff -module Stringset = Set.Make(struct type t = string let compare (x:t) (y:t) = compare x y end) +module StringOrd = +struct + type t = string + external compare : string -> string -> int = "caml_string_compare" +end -module Stringmap = Map.Make(struct type t = string let compare (x:t) (y:t) = compare x y end) +module Stringset = Set.Make(StringOrd) +module Stringmap = Map.Make(StringOrd) (* Lists *) @@ -202,9 +207,14 @@ let delayed_force f = f () type ('a,'b) union = Inl of 'a | Inr of 'b -module Intset = Set.Make(struct type t = int let compare (x:t) (y:t) = compare x y end) +module IntOrd = +struct + type t = int + external compare : int -> int -> int = "caml_int_compare" +end -module Intmap = Map.Make(struct type t = int let compare (x:t) (y:t) = compare x y end) +module Intset = Set.Make(IntOrd) +module Intmap = Map.Make(IntOrd) (*s interruption *) -- cgit v1.2.3