aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJeremy Herbert <jeremy.006@gmail.com>2020-02-14 20:52:55 +1000
committerDamien George <damien@micropython.org>2022-06-10 16:42:43 +1000
commit148d12252b54d330c66ccac4bbbe6d804a8d1e8f (patch)
treec9d3a0d77162beec7c306d9db96188f561a07033 /py
parent17a0d65ee4eaa445a638d44dc9edc30d1ddbbac6 (diff)
py/dynruntime: Add macros to create a new dict and store to dicts.
Diffstat (limited to 'py')
-rw-r--r--py/dynruntime.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/dynruntime.h b/py/dynruntime.h
index 32ca708b9..9205cfd21 100644
--- a/py/dynruntime.h
+++ b/py/dynruntime.h
@@ -111,6 +111,7 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
#define mp_obj_new_bytearray_by_ref(n, i) (mp_fun_table.obj_new_bytearray_by_ref((n), (i)))
#define mp_obj_new_tuple(n, items) (mp_fun_table.new_tuple((n), (items)))
#define mp_obj_new_list(n, items) (mp_fun_table.new_list((n), (items)))
+#define mp_obj_new_dict(n) (mp_fun_table.new_dict((n)))
#define mp_obj_get_type(o) (mp_fun_table.obj_get_type((o)))
#define mp_obj_cast_to_native_base(o, t) (mp_obj_cast_to_native_base_dyn((o), (t)))
@@ -125,6 +126,7 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
#define mp_obj_subscr(base, index, val) (mp_fun_table.obj_subscr((base), (index), (val)))
#define mp_obj_get_array(o, len, items) (mp_obj_get_array_dyn((o), (len), (items)))
#define mp_obj_list_append(list, item) (mp_fun_table.list_append((list), (item)))
+#define mp_obj_dict_store(dict, key, val) (mp_fun_table.dict_store((dict), (key), (val)))
#define mp_obj_malloc_helper(n, t) (mp_obj_malloc_helper_dyn(n, t))