File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,6 +219,10 @@ STATIC void stop_mp(void) {
219219 usb_background ();
220220 #endif
221221
222+ // Set the qstr pool back to the const pools. The heap allocated ones will
223+ // be overwritten.
224+ qstr_reset ();
225+
222226 gc_deinit ();
223227}
224228
Original file line number Diff line number Diff line change @@ -122,9 +122,13 @@ extern const qstr_pool_t MICROPY_QSTR_EXTRA_POOL;
122122#define CONST_POOL mp_qstr_const_pool
123123#endif
124124
125- void qstr_init (void ) {
125+ void qstr_reset (void ) {
126126 MP_STATE_VM (last_pool ) = (qstr_pool_t * )& CONST_POOL ; // we won't modify the const_pool since it has no allocated room left
127127 MP_STATE_VM (qstr_last_chunk ) = NULL ;
128+ }
129+
130+ void qstr_init (void ) {
131+ qstr_reset ();
128132
129133 #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
130134 mp_thread_mutex_init (& MP_STATE_VM (qstr_mutex ));
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ typedef struct _qstr_pool_t {
7878
7979#define QSTR_TOTAL () (MP_STATE_VM(last_pool)->total_prev_len + MP_STATE_VM(last_pool)->len)
8080
81+ void qstr_reset (void );
8182void qstr_init (void );
8283
8384mp_uint_t qstr_compute_hash (const byte * data , size_t len );
You can’t perform that action at this time.
0 commit comments