diff --git a/inc/MicroBitConfig.h b/inc/MicroBitConfig.h index d65b86f..274637b 100644 --- a/inc/MicroBitConfig.h +++ b/inc/MicroBitConfig.h @@ -39,7 +39,7 @@ // The proportion of SRAM available on the mbed heap to reserve for the micro:bit heap. #ifndef MICROBIT_HEAP_SIZE -#define MICROBIT_HEAP_SIZE 0.25 +#define MICROBIT_HEAP_SIZE 0.9 #endif // if defined, reuse the 8K of SRAM reserved for SoftDevice (Nordic's memory resident BLE stack) as heap memory. diff --git a/inc/MicroBitHeapAllocator.h b/inc/MicroBitHeapAllocator.h index fef6ffb..c8934c5 100644 --- a/inc/MicroBitHeapAllocator.h +++ b/inc/MicroBitHeapAllocator.h @@ -91,6 +91,14 @@ inline void* operator new(size_t size) throw(std::bad_alloc) return microbit_malloc(size); } +/** + * Overrides the 'new' operator globally, and redirects calls to the micro:bit theap allocator. + */ +inline void* operator new[](size_t size) throw(std::bad_alloc) +{ + return microbit_malloc(size); +} + /** * Overrides the 'delete' operator globally, and redirects calls to the micro:bit theap allocator. */