From 8a3707825ca92e1e23c8a52827b491091c435fdd Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 9 Dec 2016 16:29:17 -0800 Subject: [PATCH] Core.Std.Gc Reviewed By: cristianoc Differential Revision: D4232440 fbshipit-source-id: 1b392c4 --- infer/src/backend/InferPrint.re | 6 +++--- infer/src/backend/timeout.ml | 4 +++- infer/src/base/Config.ml | 4 ++-- infer/src/base/Utils.ml | 1 + infer/src/base/Utils.mli | 1 + 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index 92e8af4ca3d..d592fa14c1d 100644 --- a/infer/src/backend/InferPrint.re +++ b/infer/src/backend/InferPrint.re @@ -1224,10 +1224,10 @@ let module AnalysisResults = { /** apply [f] to [arg] with the gc compaction disabled during the execution */ let apply_without_gc f arg => { let stat = Gc.get (); - let space_oh = stat.Gc.space_overhead; - Gc.set {...stat, Gc.space_overhead: 10000}; + let space_oh = stat.space_overhead; + Gc.set {...stat, space_overhead: 10000}; let res = f arg; - Gc.set {...stat, Gc.space_overhead: space_oh}; + Gc.set {...stat, space_overhead: space_oh}; res }; diff --git a/infer/src/backend/timeout.ml b/infer/src/backend/timeout.ml index d23ffca8423..15000492c35 100644 --- a/infer/src/backend/timeout.ml +++ b/infer/src/backend/timeout.ml @@ -84,7 +84,9 @@ let timeout_action _ = raise (SymOp.Analysis_failure_exe (FKtimeout)) let () = - (* Can't use Core since it wraps signal handlers with a catch-all exception handler that exits *) + (* Can't use Core since it wraps signal handlers and alarms with catch-all exception handlers that + exit, while we need to propagate the timeout exceptions. *) + let module Gc = Caml.Gc in let module Sys = Caml.Sys in match Config.os_type with | Config.Unix | Config.Cygwin -> diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index e4e3b4d8ea8..1c455b38548 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1387,8 +1387,8 @@ let post_parsing_initialization () = let set_minor_heap_size nMb = (* increase the minor heap size to speed up gc *) let ctrl = Gc.get () in let words_of_Mb nMb = nMb * 1024 * 1024 * 8 / Sys.word_size in - let new_size = max ctrl.Gc.minor_heap_size (words_of_Mb nMb) in - Gc.set { ctrl with Gc.minor_heap_size = new_size } + let new_size = max ctrl.minor_heap_size (words_of_Mb nMb) in + Gc.set { ctrl with minor_heap_size = new_size } in set_minor_heap_size 8 ; diff --git a/infer/src/base/Utils.ml b/infer/src/base/Utils.ml index 6e1c750d0be..b7bc93986f2 100644 --- a/infer/src/base/Utils.ml +++ b/infer/src/base/Utils.ml @@ -18,6 +18,7 @@ module Caml = Core.Std.Caml module Char = Core.Std.Char module Filename = Core.Std.Filename module Fn = Core.Std.Fn +module Gc = Core.Std.Gc module In_channel = Core.Std.In_channel module Int = Core.Std.Int module Option = Core.Std.Option diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index db1517155ba..282e964bf54 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -18,6 +18,7 @@ module Caml = Core.Std.Caml module Char = Core.Std.Char module Filename = Core.Std.Filename module Fn = Core.Std.Fn +module Gc = Core.Std.Gc module In_channel = Core.Std.In_channel module Int = Core.Std.Int module Option = Core.Std.Option