diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-29 11:39:36 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-29 11:39:36 +0000 |
commit | d1e443d0bc073c55ffab880292f3b645ed37a029 (patch) | |
tree | d8992d871548e0b773c02ced45b72ad8be6cc96f /py/runtime.h | |
parent | 682f9e639d140849a5b33aecb74e2e2cb2c6ee77 (diff) | |
download | micropython-d1e443d0bc073c55ffab880292f3b645ed37a029.tar.gz micropython-d1e443d0bc073c55ffab880292f3b645ed37a029.zip |
py: Free unique_code slot for outer module.
Partly (very partly!) addresses issue #386. Most importantly, at the
REPL command line, each invocation does not now lead to increased memory
usage (unless you define a function/lambda).
Diffstat (limited to 'py/runtime.h')
-rw-r--r-- | py/runtime.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/runtime.h b/py/runtime.h index b27d12ff1d..a8f83e529d 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -18,11 +18,11 @@ void rt_store_global(qstr qstr, mp_obj_t obj); void rt_delete_name(qstr qstr); mp_obj_t rt_unary_op(int op, mp_obj_t arg); mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs); -mp_obj_t rt_make_function_from_id(int unique_code_id, mp_obj_t def_args); +mp_obj_t rt_make_function_from_id(uint unique_code_id, bool free_unique_code, mp_obj_t def_args); mp_obj_t rt_make_function_n(int n_args, void *fun); // fun must have the correct signature for n_args fixed arguments mp_obj_t rt_make_function_var(int n_args_min, mp_fun_var_t fun); mp_obj_t rt_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var_t fun); // min and max are inclusive -mp_obj_t rt_make_closure_from_id(int unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args); +mp_obj_t rt_make_closure_from_id(uint unique_code_id, mp_obj_t closure_tuple, mp_obj_t def_args); mp_obj_t rt_call_function_0(mp_obj_t fun); mp_obj_t rt_call_function_1(mp_obj_t fun, mp_obj_t arg); mp_obj_t rt_call_function_2(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); |