aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar Matej Kosik <m4tej.kosik@gmail.com>2015-12-16 15:35:27 +0100
committerGravatar Matej Kosik <m4tej.kosik@gmail.com>2015-12-18 15:58:24 +0100
commitc429770d4fc36497cfd02874a665c1ff2f1a0496 (patch)
treef3e1f6758a99379503a29bc8c689f36c45840a76 /toplevel
parentc87c45877c7a9d571be5f215fac6de1ca7e3ca38 (diff)
CLEANUP: simplifying "Coqtop.init_gc" implementation
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/coqtop.ml25
1 files changed, 13 insertions, 12 deletions
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index 4b48b17fd..2aad417e8 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -257,18 +257,19 @@ let set_emacs () =
*)
let init_gc () =
- let param =
- try ignore (Sys.getenv "OCAMLRUNPARAM"); true
- with Not_found -> false
- in
- let control = Gc.get () in
- let tweaked_control = { control with
- Gc.minor_heap_size = 33554432; (** 4M *)
-(* Gc.major_heap_increment = 268435456; (** 32M *) *)
- Gc.space_overhead = 120;
- } in
- if param then ()
- else Gc.set tweaked_control
+ try
+ (* OCAMLRUNPARAM environment variable is set.
+ * In that case, we let ocamlrun to use the values provided by the user.
+ *)
+ ignore (Sys.getenv "OCAMLRUNPARAM")
+
+ with Not_found ->
+ (* OCAMLRUNPARAM environment variable is not set.
+ * In this case, we put in place our preferred configuration.
+ *)
+ Gc.set { (Gc.get ()) with
+ Gc.minor_heap_size = 33554432; (** 4M *)
+ Gc.space_overhead = 120}
(*s Parsing of the command line.
We no longer use [Arg.parse], in order to use share [Usage.print_usage]