Core.Std.Gc

Reviewed By: cristianoc

Differential Revision: D4232440

fbshipit-source-id: 1b392c4
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent e5b41a67d0
commit 8a3707825c

@ -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
};

@ -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 ->

@ -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 ;

@ -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

@ -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

Loading…
Cancel
Save