diff options
| author | Damien George <damien.p.george@gmail.com> | 2016-10-18 11:49:27 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2016-10-21 16:26:01 +1100 |
| commit | 571e6f26dbd7e0e38441bc402f76d293303063b2 (patch) | |
| tree | d720bcd32665e9cdcc9e2e00513f3b5e894da992 /drivers/cc3000/src/ccspi.c | |
| parent | 4ebdb1f2b217410cdc1cee0e0c0da8fceb7627f2 (diff) | |
py: Specialise builtin funcs to use separate type for fixed arg count.
Builtin functions with a fixed number of arguments (0, 1, 2 or 3) are
quite common. Before this patch the wrapper for such a function cost
3 machine words. After this patch it only takes 2, which can reduce the
code size by quite a bit (and pays off even more, the more functions are
added). It also makes function dispatch slightly more efficient in CPU
usage, and furthermore reduces stack usage for these cases. On x86 and
Thumb archs the dispatch functions are now tail-call optimised by the
compiler.
The bare-arm port has its code size increase by 76 bytes, but stmhal drops
by 904 bytes. Stack usage by these builtin functions is decreased by 48
bytes on Thumb2 archs.
Diffstat (limited to 'drivers/cc3000/src/ccspi.c')
| -rw-r--r-- | drivers/cc3000/src/ccspi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cc3000/src/ccspi.c b/drivers/cc3000/src/ccspi.c index 1606bfd57..64900efe4 100644 --- a/drivers/cc3000/src/ccspi.c +++ b/drivers/cc3000/src/ccspi.c @@ -99,7 +99,7 @@ STATIC tSpiInformation sSpiInformation; STATIC char spi_buffer[CC3000_RX_BUFFER_SIZE]; unsigned char wlan_tx_buffer[CC3000_TX_BUFFER_SIZE]; -STATIC const mp_obj_fun_builtin_t irq_callback_obj; +STATIC const mp_obj_fun_builtin_fixed_t irq_callback_obj; // set the pins to use to communicate with the CC3000 // the arguments must be of type pin_obj_t* and SPI_HandleTypeDef* |
