From b4b10fd350852e321624d74983cca286091b55a1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 1 Jan 2015 23:30:53 +0000 Subject: py: Put all global state together in state structures. This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient. --- py/vm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'py/vm.c') diff --git a/py/vm.c b/py/vm.c index b0f778352..72dfb8a01 100644 --- a/py/vm.c +++ b/py/vm.c @@ -29,6 +29,7 @@ #include #include +#include "py/mpstate.h" #include "py/nlr.h" #include "py/emitglue.h" #include "py/runtime.h" @@ -991,10 +992,10 @@ yield: #endif pending_exception_check: - if (mp_pending_exception != MP_OBJ_NULL) { + if (MP_STATE_VM(mp_pending_exception) != MP_OBJ_NULL) { MARK_EXC_IP_SELECTIVE(); - mp_obj_t obj = mp_pending_exception; - mp_pending_exception = MP_OBJ_NULL; + mp_obj_t obj = MP_STATE_VM(mp_pending_exception); + MP_STATE_VM(mp_pending_exception) = MP_OBJ_NULL; RAISE(obj); } -- cgit v1.2.3