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() { void platform_init() {
microbit_seed_random(); microbit_seed_random();
seedRandom(microbit_random(0x7fffffff)); seedRandom(microbit_random(0x7fffffff));
if (device_heap_size(1)) if (device_heap_size(1) > NON_GC_HEAP_RESERVATION + 4)
gcPreAllocateBlock(device_heap_size(1) - 4); gcPreAllocateBlock(device_heap_size(1) - NON_GC_HEAP_RESERVATION);
} }
void platform_init(); void platform_init();

View File

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