We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 59b1bed + e544909 commit ad663cbCopy full SHA for ad663cb
py/gc.c
@@ -150,8 +150,10 @@ void gc_init(void *start, void *end) {
150
assert(MP_STATE_MEM(gc_pool_start) >= MP_STATE_MEM(gc_finaliser_table_start) + gc_finaliser_table_byte_len);
151
#endif
152
153
- // clear ATBs
154
- memset(MP_STATE_MEM(gc_alloc_table_start), 0, MP_STATE_MEM(gc_alloc_table_byte_len));
+ // Clear ATBs plus one more byte. The extra byte might be read when we read the final ATB and
+ // then try to count its tail. Clearing the byte ensures it is 0 and ends the chain. Without an
155
+ // FTB, it'll just clear the pool byte early.
156
+ memset(MP_STATE_MEM(gc_alloc_table_start), 0, MP_STATE_MEM(gc_alloc_table_byte_len) + 1);
157
158
#if MICROPY_ENABLE_FINALISER
159
// clear FTBs
0 commit comments