File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,10 @@ STATIC void stop_mp(void) {
219
219
usb_background ();
220
220
#endif
221
221
222
+ // Set the qstr pool back to the const pools. The heap allocated ones will
223
+ // be overwritten.
224
+ qstr_reset ();
225
+
222
226
gc_deinit ();
223
227
}
224
228
Original file line number Diff line number Diff line change @@ -122,9 +122,13 @@ extern const qstr_pool_t MICROPY_QSTR_EXTRA_POOL;
122
122
#define CONST_POOL mp_qstr_const_pool
123
123
#endif
124
124
125
- void qstr_init (void ) {
125
+ void qstr_reset (void ) {
126
126
MP_STATE_VM (last_pool ) = (qstr_pool_t * )& CONST_POOL ; // we won't modify the const_pool since it has no allocated room left
127
127
MP_STATE_VM (qstr_last_chunk ) = NULL ;
128
+ }
129
+
130
+ void qstr_init (void ) {
131
+ qstr_reset ();
128
132
129
133
#if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL
130
134
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 {
78
78
79
79
#define QSTR_TOTAL () (MP_STATE_VM(last_pool)->total_prev_len + MP_STATE_VM(last_pool)->len)
80
80
81
+ void qstr_reset (void );
81
82
void qstr_init (void );
82
83
83
84
mp_uint_t qstr_compute_hash (const byte * data , size_t len );
You can’t perform that action at this time.
0 commit comments