diff options
author | David Lechner <david@pybricks.com> | 2022-03-29 12:11:42 -0500 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-03-31 17:00:50 +1100 |
commit | 3679a47eb064850406f473bc435c36d95017c16e (patch) | |
tree | f62069dc67bf183696806156f735153dc69fed71 /tests/basics/fun_callstardblstar.py | |
parent | 783b1a868fb0f3c1fd6cf7231311c24801c33505 (diff) | |
download | micropython-3679a47eb064850406f473bc435c36d95017c16e.tar.gz micropython-3679a47eb064850406f473bc435c36d95017c16e.zip |
py/runtime: Do not overallocate when len is known.
This fixes overallocating an extra mp_obj_t when the length of *args and
**args is known. Previously we were allocating 1 mp_obj_t for each
n_args and n_kw plus the length of each *arg and **arg (if they are
known). Since n_args includes *args and n_kw includes **args, this was
allocating an extra mp_obj_t in addition to the length of these args
when unpacked.
To fix this, we just subtract 1 from the length to account for the 1
already implicitly allocated by n_args and n_kw.
Signed-off-by: David Lechner <david@pybricks.com>
Diffstat (limited to 'tests/basics/fun_callstardblstar.py')
0 files changed, 0 insertions, 0 deletions