Enable PYSTACK to keep function state out of the heap
This commit is contained in:
parent
9cdf5e148a
commit
1160635608
8
main.c
8
main.c
|
@ -97,6 +97,10 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
|
|||
}
|
||||
}
|
||||
|
||||
#if MICROPY_ENABLE_PYSTACK
|
||||
static size_t PLACE_IN_DTCM_BSS(_pystack)[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)];
|
||||
#endif
|
||||
|
||||
void start_mp(supervisor_allocation* heap) {
|
||||
reset_status_led();
|
||||
autoreload_stop();
|
||||
|
@ -125,6 +129,10 @@ void start_mp(supervisor_allocation* heap) {
|
|||
// Clear the readline history. It references the heap we're about to destroy.
|
||||
readline_init0();
|
||||
|
||||
#if MICROPY_ENABLE_PYSTACK
|
||||
mp_pystack_init(_pystack, _pystack + sizeof(_pystack));
|
||||
#endif
|
||||
|
||||
#if MICROPY_ENABLE_GC
|
||||
gc_init(heap->ptr, heap->ptr + heap->length / 4);
|
||||
#endif
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#define MICROPY_QSTR_BYTES_IN_HASH (1)
|
||||
#define MICROPY_REPL_AUTO_INDENT (1)
|
||||
#define MICROPY_REPL_EVENT_DRIVEN (0)
|
||||
#define MICROPY_ENABLE_PYSTACK (1)
|
||||
#define MICROPY_STACK_CHECK (1)
|
||||
#define MICROPY_STREAMS_NON_BLOCK (1)
|
||||
#ifndef MICROPY_USE_INTERNAL_PRINTF
|
||||
|
@ -785,6 +786,10 @@ void supervisor_run_background_tasks_if_tick(void);
|
|||
#define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000
|
||||
#endif
|
||||
|
||||
#ifndef CIRCUITPY_PYSTACK_SIZE
|
||||
#define CIRCUITPY_PYSTACK_SIZE 1024
|
||||
#endif
|
||||
|
||||
#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
|
||||
|
||||
#define CIRCUITPY_VERBOSE_BLE 0
|
||||
|
|
Loading…
Reference in New Issue