Decrease size of GC heap to allow more DAL allocs (#2246)

This commit is contained in:
Michał Moskal 2019-07-17 06:23:13 -07:00 committed by Peli de Halleux
parent b042009088
commit acf462fb61
2 changed files with 3 additions and 6 deletions

View File

@ -28,8 +28,8 @@ MicroBitEvent lastEvent;
void platform_init() {
microbit_seed_random();
seedRandom(microbit_random(0x7fffffff));
if (device_heap_size(1))
gcPreAllocateBlock(device_heap_size(1) - 4);
if (device_heap_size(1) > NON_GC_HEAP_RESERVATION + 4)
gcPreAllocateBlock(device_heap_size(1) - NON_GC_HEAP_RESERVATION);
}
void platform_init();

View File

@ -16,11 +16,8 @@ void debuglog(const char *format, ...);
#define GC_MAX_ALLOC_SIZE 9000
#if CONFIG_ENABLED(MICROBIT_BLE_ENABLED)
#define GC_BLOCK_SIZE 256
#else
#define GC_BLOCK_SIZE 1000
#endif
#define NON_GC_HEAP_RESERVATION 1024
#define DMESG NOLOG