Fix decompressing using qstrs after running the VM
The qstr state still pointed to qstr pools in the released MP heap.
This commit is contained in:
parent
5126cd3dc3
commit
bf3d84195f
4
main.c
4
main.c
@ -219,6 +219,10 @@ STATIC void stop_mp(void) {
|
||||
usb_background();
|
||||
#endif
|
||||
|
||||
// Set the qstr pool back to the const pools. The heap allocated ones will
|
||||
// be overwritten.
|
||||
qstr_reset();
|
||||
|
||||
gc_deinit();
|
||||
}
|
||||
|
||||
|
@ -122,9 +122,13 @@ extern const qstr_pool_t MICROPY_QSTR_EXTRA_POOL;
|
||||
#define CONST_POOL mp_qstr_const_pool
|
||||
#endif
|
||||
|
||||
void qstr_init(void) {
|
||||
void qstr_reset(void) {
|
||||
MP_STATE_VM(last_pool) = (qstr_pool_t *)&CONST_POOL; // we won't modify the const_pool since it has no allocated room left
|
||||
MP_STATE_VM(qstr_last_chunk) = NULL;
|
||||
}
|
||||
|
||||
void qstr_init(void) {
|
||||
qstr_reset();
|
||||
|
||||
#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
|
||||
mp_thread_mutex_init(&MP_STATE_VM(qstr_mutex));
|
||||
|
Loading…
x
Reference in New Issue
Block a user