]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/binaries/utilities/test_library.ml
better spacing
[helm.git] / helm / software / components / binaries / utilities / test_library.ml
index 5cfb7c3487276e2d38f85229e5da13dacd86a7be..98ade3adb54ad8a8e408d8771808efbb02a37d08 100644 (file)
@@ -83,12 +83,26 @@ let _ =
         Printf.printf "%s " uri;
         flush stdout;
         let uri = UriManager.uri_of_string uri in
-        let before = Unix.gettimeofday () in
+        let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in
         ignore (Unix.alarm deadline);
-        ignore (CicTypeChecker.typecheck uri);
+        CicTypeChecker.typecheck_obj uri obj;
         ignore (Unix.alarm 0);
-        let after = Unix.gettimeofday () in
-        let diff = after -. before in
+        CicEnvironment.remove_obj uri;
+        let before = Unix.times () in
+        ignore (Unix.alarm deadline);
+        ignore (CicTypeChecker.typecheck_obj uri obj);
+        ignore (Unix.alarm 0);
+        let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in
+        if memusage > 500 then
+         begin
+          prerr_endline ("MEMORIA ALLOCATA: " ^ string_of_int memusage ^ "Mb");
+          CicEnvironment.empty ();
+          Gc.compact ();
+          let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in
+            prerr_endline ("DOPO CicEnvironment.empty: " ^ string_of_int memusage ^ "Mb");
+         end;
+        let after = Unix.times () in
+        let diff = after.Unix.tms_utime +. after.Unix.tms_stime -. before.Unix.tms_utime -. before.Unix.tms_stime in
         new_total := !new_total +. diff;
         Printf.printf "\e[0;32mOK\e[0m %.2f" diff;
         (match time with