Use gcPreAllocateBlock() to fix #2177, #2215 (#2216)

* Use gcPreAllocateBlock() to fix #2177, #2215
* bump pcp 6.9.4
This commit is contained in:
Michał Moskal 2019-07-01 18:39:12 -07:00 committed by Daryl Zuniga
parent cc06e91c25
commit 28b5b293b5
3 changed files with 9 additions and 3 deletions

View File

@ -18,14 +18,18 @@ extern "C" void target_reset() {
microbit_reset(); microbit_reset();
} }
uint32_t device_heap_size(uint8_t heap_index); // defined in microbit-dal
namespace pxt { namespace pxt {
MicroBit uBit; MicroBit uBit;
MicroBitEvent lastEvent; 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))
gcPreAllocateBlock(device_heap_size(1) - 4);
} }
void platform_init(); void platform_init();

View File

@ -14,6 +14,8 @@ void debuglog(const char *format, ...);
#define xmalloc malloc #define xmalloc malloc
#define xfree free #define xfree free
#define GC_MAX_ALLOC_SIZE 9000
#if CONFIG_ENABLED(MICROBIT_BLE_ENABLED) #if CONFIG_ENABLED(MICROBIT_BLE_ENABLED)
#define GC_BLOCK_SIZE 256 #define GC_BLOCK_SIZE 256
#else #else

View File

@ -45,7 +45,7 @@
"@types/web-bluetooth": "0.0.4" "@types/web-bluetooth": "0.0.4"
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "6.9.3", "pxt-common-packages": "6.9.4",
"pxt-core": "5.15.10" "pxt-core": "5.15.10"
} }
} }