aboutsummaryrefslogtreecommitdiff
path: root/py/mpstate.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-07-27 00:39:04 +1000
committerDamien George <damien@micropython.org>2022-03-10 10:43:21 +1100
commitbc181550a4790f4dcfaf10e7e61ecfcdf346d5a8 (patch)
treebe0e3389c6de1bb02af4a67fbe1cae4c0402b60a /py/mpstate.h
parent3356b5ef8d1b232a1df493f70f0ba434f293fe11 (diff)
py/modsys: Add optional attribute delegation.
To be enabled when needed by specific sys attributes. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpstate.h')
-rw-r--r--py/mpstate.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/py/mpstate.h b/py/mpstate.h
index 7f86399f5..f29e6be50 100644
--- a/py/mpstate.h
+++ b/py/mpstate.h
@@ -40,6 +40,10 @@
// memory system, runtime and virtual machine. The state is a global
// variable, but in the future it is hoped that the state can become local.
+enum {
+ MP_SYS_MUTABLE_NUM,
+};
+
// This structure contains dynamic configuration for the compiler.
#if MICROPY_DYNAMIC_COMPILER
typedef struct mp_dynamic_compiler_t {
@@ -158,6 +162,11 @@ typedef struct _mp_state_vm_t {
// must be initialised after the call to mp_init.
mp_obj_list_t mp_sys_path_obj;
mp_obj_list_t mp_sys_argv_obj;
+
+ #if MICROPY_PY_SYS_ATTR_DELEGATION
+ // Contains mutable sys attributes.
+ mp_obj_t sys_mutable[MP_SYS_MUTABLE_NUM];
+ #endif
#endif
// dictionary for overridden builtins