aboutsummaryrefslogtreecommitdiff
path: root/py/gc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-22 22:44:56 +0000
committerDamien George <damien.p.george@gmail.com>2016-06-28 11:09:31 +0100
commit330165a2cc9a0d4d5d00f13f851412c25d5f4ed2 (patch)
tree51e3fb1500e57441899d914f85e69a8436bfe81b /py/gc.c
parent3545ef8bb49d9ad02e85bd13f478072f8059c582 (diff)
py: Add MP_STATE_THREAD to hold state specific to a given thread.
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c4
1 files changed, 2 insertions, 2 deletions
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) {