From 0b11cc1ee26dda1dcdab60ae593c74acdf162291 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sun, 28 Jun 2020 20:11:28 +0200 Subject: [PATCH] [ocaml] Restore compatibility with OCaml 4.12 OCaml 4.12 has introduced a new field in the `Gc.stats` record, `forced_major_collections`. This makes compilation of Dune fail due to `src/catapult/catapult.ml:fake_gc_stat` We call `Gc.quick_stats` and override the set of safe fields. Fixes: #3583 cc: #2298 --- src/catapult/catapult.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/catapult/catapult.ml b/src/catapult/catapult.ml index ae4d53290632..c7336abf1a88 100644 --- a/src/catapult/catapult.ml +++ b/src/catapult/catapult.ml @@ -10,7 +10,9 @@ type t = } let fake_gc_stat = - { Gc.minor_words = 0. + let init_gc = Gc.quick_stats () in + { init_gc with + Gc.minor_words = 0. ; promoted_words = 0. ; major_words = 0. ; minor_collections = 0