From 412a71dee8aca52db28cfb014c4857c0a5e3f1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Moskal?= Date: Tue, 19 Nov 2019 21:48:12 -0800 Subject: [PATCH] Fix GC heap reclamation (#2528) --- libs/core/codal.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/core/codal.cpp b/libs/core/codal.cpp index a214ab00..a5fafe4e 100644 --- a/libs/core/codal.cpp +++ b/libs/core/codal.cpp @@ -31,6 +31,7 @@ void platform_init() { } void initMicrobitGC() { + uBit.init(); if (device_heap_size(1) > NON_GC_HEAP_RESERVATION + 4) gcPreAllocateBlock(device_heap_size(1) - NON_GC_HEAP_RESERVATION); } @@ -43,9 +44,6 @@ struct FreeList { }; static void initCodal() { - - uBit.init(); - // repeat error 4 times and restart as needed microbit_panic_timeout(4); }