diff --git a/infer/src/backend/InferPrint.re b/infer/src/backend/InferPrint.re index 92e8af4ca..d592fa14c 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 d23ffca84..15000492c 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 e4e3b4d8e..1c455b385 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 6e1c750d0..b7bc93986 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 db1517155..282e964bf 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