Skip to content
Snippets Groups Projects
Select Git revision
  • dualcore
  • ch3/leds
  • wip-bootstrap default
  • ch3/time
  • master
5 results

bufhelper.c

Blame
    • Damien George's avatar
      05005f67
      py: Remove mp_obj_str_builder and use vstr instead. · 05005f67
      Damien George authored
      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.
      05005f67
      History
      py: Remove mp_obj_str_builder and use vstr instead.
      Damien George authored
      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.