Commit 71b6a85
committed
py/objtuple: Make mp_obj_tuple_get an inline function.
This can be done now that it's declared in `py/objtuple.h`, where the
`mp_obj_tuple` struct is defined.
This allows much better code generation for users of `mp_obj_tuple_get()`
where the caller uses len/items immediately (which is most uses), because
the compiler no longer needs to allocate the return values on the stack.
Changes code size by -36 bytes on bare-arm and -56 bytes on stm32.
Signed-off-by: Damien George <damien@micropython.org>1 parent 90f259f commit 71b6a85
2 files changed
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | 254 | | |
262 | 255 | | |
263 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 76 | | |
0 commit comments