-
- Downloads
py: Remove mp_obj_str_builder and use vstr instead.
With this patch str/bytes construction is streamlined. Always use a vstr to build a str/bytes object. If the size is known beforehand then use vstr_init_len to allocate only required memory. Otherwise use vstr_init and the vstr will grow as needed. Then use mp_obj_new_str_from_vstr to create a str/bytes object using the vstr memory. Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes on unix x64.
Showing
- extmod/modubinascii.c 4 additions, 3 deletionsextmod/modubinascii.c
- extmod/moduhashlib.c 4 additions, 4 deletionsextmod/moduhashlib.c
- py/compile.c 4 additions, 3 deletionspy/compile.c
- py/misc.h 1 addition, 0 deletionspy/misc.h
- py/modstruct.c 5 additions, 3 deletionspy/modstruct.c
- py/obj.h 0 additions, 3 deletionspy/obj.h
- py/objint.c 4 additions, 3 deletionspy/objint.c
- py/objstr.c 25 additions, 54 deletionspy/objstr.c
- py/stream.c 11 additions, 8 deletionspy/stream.c
- py/vstr.c 5 additions, 0 deletionspy/vstr.c
- stmhal/bufhelper.c 8 additions, 6 deletionsstmhal/bufhelper.c
- stmhal/bufhelper.h 1 addition, 1 deletionstmhal/bufhelper.h
- stmhal/can.c 4 additions, 4 deletionsstmhal/can.c
- stmhal/i2c.c 13 additions, 13 deletionsstmhal/i2c.c
- stmhal/moduos.c 4 additions, 4 deletionsstmhal/moduos.c
- stmhal/modusocket.c 15 additions, 14 deletionsstmhal/modusocket.c
- stmhal/spi.c 17 additions, 15 deletionsstmhal/spi.c
- stmhal/usb.c 5 additions, 5 deletionsstmhal/usb.c
Loading
Please register or sign in to comment