From 1a0797eeeb476bc702d8d9c39f1ddf4194e855cf Mon Sep 17 00:00:00 2001 From: Wojtek Czekalski Date: Wed, 3 Apr 2019 14:35:56 +0200 Subject: [PATCH] Add temporary Gc.minor workaround in UIEventCallback --- renderer-macos/lib/bindings/UIEventCallback.re | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderer-macos/lib/bindings/UIEventCallback.re b/renderer-macos/lib/bindings/UIEventCallback.re index b1dc1b9..3561cd1 100644 --- a/renderer-macos/lib/bindings/UIEventCallback.re +++ b/renderer-macos/lib/bindings/UIEventCallback.re @@ -1,5 +1,11 @@ let make = (callback, ()) => { callback(); + /* This is a workaround for non-deterministic crashes + * when OCaml wants to allocate huge amounts of memory. + * This crash still happens but is a lot less frequent. + * A very negative side effect is terrible performance. + */ + Gc.minor(); Brisk.UI.flushPendingUpdates(); Brisk.UI.executeHostViewUpdatesAndLayout(); LwtFakeIOEvent.send();