From 330165a2cc9a0d4d5d00f13f851412c25d5f4ed2 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 22 Apr 2016 22:44:56 +0000 Subject: py: Add MP_STATE_THREAD to hold state specific to a given thread. --- py/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/gc.c') diff --git a/py/gc.c b/py/gc.c index a1ba45a2b..ebf699514 100644 --- a/py/gc.c +++ b/py/gc.c @@ -279,7 +279,7 @@ void gc_collect_start(void) { // correctly in the mp_state_ctx structure. We scan nlr_top, dict_locals, // dict_globals, then the root pointer section of mp_state_vm. void **ptrs = (void**)(void*)&mp_state_ctx; - gc_collect_root(ptrs, offsetof(mp_state_ctx_t, vm.stack_top) / sizeof(void*)); + gc_collect_root(ptrs, offsetof(mp_state_ctx_t, vm.qstr_last_chunk) / sizeof(void*)); } void gc_collect_root(void **ptrs, size_t len) { @@ -713,7 +713,7 @@ void gc_dump_alloc_table(void) { } if (c == 'h') { ptrs = (void**)&c; - len = ((mp_uint_t)MP_STATE_VM(stack_top) - (mp_uint_t)&c) / sizeof(mp_uint_t); + len = ((mp_uint_t)MP_STATE_THREAD(stack_top) - (mp_uint_t)&c) / sizeof(mp_uint_t); for (mp_uint_t i = 0; i < len; i++) { mp_uint_t ptr = (mp_uint_t)ptrs[i]; if (VERIFY_PTR(ptr) && BLOCK_FROM_PTR(ptr) == bl) { -- cgit v1.2.3