diff options
author | Damien George <damien@micropython.org> | 2021-07-27 00:39:04 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-03-10 10:43:21 +1100 |
commit | bc181550a4790f4dcfaf10e7e61ecfcdf346d5a8 (patch) | |
tree | be0e3389c6de1bb02af4a67fbe1cae4c0402b60a /py/mpstate.h | |
parent | 3356b5ef8d1b232a1df493f70f0ba434f293fe11 (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.h | 9 |
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 |