diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-01 23:30:53 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-07 20:33:00 +0000 |
commit | b4b10fd350852e321624d74983cca286091b55a1 (patch) | |
tree | 7ac4aa40d70be0170a61f649e9d73c42faa4ba33 /py/vm.c | |
parent | ad2307c92c15f0aa90dbd0741fd2538719d0b5e1 (diff) |
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.
Diffstat (limited to 'py/vm.c')
-rw-r--r-- | py/vm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -29,6 +29,7 @@ #include <string.h> #include <assert.h> +#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); } |