Fix GC heap reclamation (#2528)

This commit is contained in:
Michał Moskal
2019-11-19 21:48:12 -08:00
committed by Peli de Halleux
parent 7ff14ccd53
commit 412a71dee8

View File

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