Skip to content
Snippets Groups Projects
  1. Feb 19, 2019
  2. Dec 15, 2018
  3. Nov 29, 2017
  4. Nov 01, 2017
    • Damien George's avatar
      py/compile: Use alloca instead of qstr_build when compiling import name. · 487dbdb2
      Damien George authored
      The technique of using alloca is how dotted import names are composed in
      mp_import_from and mp_builtin___import__, so use the same technique in the
      compiler.  This puts less pressure on the heap (only the stack is used if
      the qstr already exists, and if it doesn't exist then the standard qstr
      block memory is used for the new qstr rather than a separate chunk of the
      heap) and reduces overall code size.
      487dbdb2
  5. Aug 15, 2017
  6. Jul 31, 2017
  7. Nov 02, 2016
    • Colin Hogben's avatar
      py: Fix wrong assumption that m_renew will not move if shrinking · f9b6b37c
      Colin Hogben authored
      In both parse.c and qstr.c, an internal chunking allocator tidies up
      by calling m_renew to shrink an allocated chunk to the size used, and
      assumes that the chunk will not move.  However, when MICROPY_ENABLE_GC
      is false, m_renew calls the system realloc, which does not guarantee
      this behaviour.  Environments where realloc may return a different
      pointer include:
      
      (1) mbed-os with MBED_HEAP_STATS_ENABLED (which adds a wrapper around
      malloc & friends; this is where I was hit by the bug);
      
      (2) valgrind on linux (how I diagnosed it).
      
      The fix is to call m_renew_maybe with allow_move=false.
      f9b6b37c
  8. Sep 19, 2016
  9. Jun 28, 2016
  10. Jun 15, 2016
  11. Apr 19, 2016
    • Paul Sokolovsky's avatar
      py: Rework QSTR extraction to work in simple and obvious way. · c618f91e
      Paul Sokolovsky authored
      When there're C files to be (re)compiled, they're all passed first to
      preprocessor. QSTR references are extracted from preprocessed output and
      split per original C file. Then all available qstr files (including those
      generated previously) are catenated together. Only if the resulting content
      has changed, the output file is written (causing almost global rebuild
      to pick up potentially renumbered qstr's). Otherwise, it's not updated
      to not cause spurious rebuilds. Related make rules are split to minimize
      amount of commands executed in the interim case (when some C files were
      updated, but no qstrs were changed).
      c618f91e
  12. Apr 13, 2016
  13. Dec 17, 2015
  14. Nov 29, 2015
  15. Oct 13, 2015
  16. Jul 20, 2015
    • Damien George's avatar
      py: Make qstr hash size configurable, defaults to 2 bytes. · c3bd9415
      Damien George authored
      This patch makes configurable, via MICROPY_QSTR_BYTES_IN_HASH, the
      number of bytes used for a qstr hash.  It was originally fixed at 2
      bytes, and now defaults to 2 bytes.  Setting it to 1 byte will save
      ROM and RAM at a small expense of hash collisions.
      c3bd9415
  17. Jul 14, 2015
    • Damien George's avatar
      py: Improve allocation policy of qstr data. · ade9a052
      Damien George authored
      Previous to this patch all interned strings lived in their own malloc'd
      chunk.  On average this wastes N/2 bytes per interned string, where N is
      the number-of-bytes for a quanta of the memory allocator (16 bytes on 32
      bit archs).
      
      With this patch interned strings are concatenated into the same malloc'd
      chunk when possible.  Such chunks are enlarged inplace when possible,
      and shrunk to fit when a new chunk is needed.
      
      RAM savings with this patch are highly varied, but should always show an
      improvement (unless only 3 or 4 strings are interned).  New version
      typically uses about 70% of previous memory for the qstr data, and can
      lead to savings of around 10% of total memory footprint of a running
      script.
      
      Costs about 120 bytes code size on Thumb2 archs (depends on how many
      calls to gc_realloc are made).
      ade9a052
  18. Apr 16, 2015
  19. Feb 10, 2015
  20. Jan 16, 2015
  21. Jan 13, 2015
    • Damien George's avatar
      py: Never intern data of large string/bytes object; add relevant tests. · 4c81ba80
      Damien George authored
      Previously to this patch all constant string/bytes objects were
      interned by the compiler, and this lead to crashes when the qstr was too
      long (noticeable now that qstr length storage defaults to 1 byte).
      
      With this patch, long string/bytes objects are never interned, and are
      referenced directly as constant objects within generated code using
      load_const_obj.
      4c81ba80
  22. Jan 11, 2015
  23. Jan 07, 2015
  24. Jan 01, 2015
  25. Oct 31, 2014
  26. Oct 24, 2014
  27. Oct 03, 2014
  28. Jul 03, 2014
  29. Jun 21, 2014
  30. Jun 11, 2014
  31. May 25, 2014
  32. May 03, 2014
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      Blanket wide to all .c and .h files.  Some files originating from ST are
      difficult to deal with (license wise) so it was left out of those.
      
      Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
      04b9147e
  33. Apr 17, 2014
  34. Apr 16, 2014
    • Andrew Scheller's avatar
      build directory can now be renamed · 70a7d7a9
      Andrew Scheller authored
      The autogenerated header files have been moved about, and an extra
      include dir has been added, which means you can give a custom
      BUILD=newbuilddir option to make, and everything "just works"
      
      Also tidied up the way the different Makefiles build their include-
      directory flags
      70a7d7a9
  35. Apr 13, 2014
  36. Mar 25, 2014
  37. Feb 26, 2014
Loading