mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[python] Enable PYSTACK for emscripten platform: this "fixes" bug
probably due to gc_collect (we suspect that transpiled C does not have access to javascript variables preventing it from collecting all required roots and leading to deleting objects prematuraly). Enabling PyStack reduces the use of the heap and fixes the bug.
This commit is contained in:
@@ -102,6 +102,11 @@ extern "C" {
|
||||
}
|
||||
|
||||
void MicroPython::init(void * heapStart, void * heapEnd) {
|
||||
#if __EMSCRIPTEN__
|
||||
static mp_obj_t pystack[1024];
|
||||
mp_pystack_init(pystack, &pystack[MP_ARRAY_SIZE(pystack)]);
|
||||
#endif
|
||||
|
||||
volatile int stackTop;
|
||||
void * stackTopAddress = (void *)(&stackTop);
|
||||
/* We delimit the stack part that will be used by Python. The stackTop is the
|
||||
|
||||
Reference in New Issue
Block a user