1. 26 Jul, 2015 1 commit
  2. 24 Jul, 2015 2 commits
  3. 23 Jul, 2015 3 commits
  4. 06 Jun, 2015 1 commit
  5. 20 Jul, 2015 3 commits
  6. 19 Jul, 2015 1 commit
  7. 14 Jul, 2015 1 commit
    • 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
      Costs about 120 bytes code size on Thumb2 archs (depends on how many
      calls to gc_realloc are made).
  8. 06 Jul, 2015 2 commits
    • Dave Hylands's avatar
      py: Prevent many extra vstr allocations. · 9f76dcd6
      Dave Hylands authored
      I checked the entire codebase, and every place that vstr_init_len
      was called, there was a call to mp_obj_new_str_from_vstr after it.
      mp_obj_new_str_from_vstr always tries to reallocate a new buffer
      1 byte larger than the original to store the terminating null
      In many cases, if we allocated the initial buffer to be 1 byte
      longer, we can prevent this extra allocation, and just reuse
      the originally allocated buffer.
      Asking to read 256 bytes and only getting 100 will still cause
      the extra allocation, but if you ask to read 256 and get 256
      then the extra allocation will be optimized away.
      Yes - the reallocation is optimized in the heap to try and reuse
      the buffer if it can, but it takes quite a few cycles to figure
      this out.
      Note by Damien: vstr_init_len should now be considered as a
      string-init convenience function and used only when creating
      null-terminated objects.
    • Damien George's avatar
      py/repl: Fix case where shorter names are shadowed by longer names. · ef7dd8db
      Damien George authored
      Previous to this patch, if "abcd" and "ab" were possible completions
      to tab-completing "a", then tab would expand to "abcd" straight away
      if this identifier appeared first in the dict.
  9. 05 Jul, 2015 1 commit
  10. 04 Jul, 2015 1 commit
  11. 02 Jul, 2015 2 commits
  12. 28 Jun, 2015 1 commit
    • Paul Sokolovsky's avatar
      builtinimport: Fix running package submodule with -m. · 9780e552
      Paul Sokolovsky authored
      When "micropython -m pkg.mod" command was used, relative imports in pkg.mod
      didn't work, because pkg.mod.__name__ was set to __main__, and the fact that
      it's a package submodule was missed. This is an original workaround to this
      issue. TODO: investigate and compare how CPython deals with this issue.
  13. 26 Jun, 2015 3 commits
  14. 25 Jun, 2015 2 commits
    • Damien George's avatar
      py: Remove mp_load_const_bytes and instead load precreated bytes object. · 59fba2d6
      Damien George authored
      Previous to this patch each time a bytes object was referenced a new
      instance (with the same data) was created.  With this patch a single
      bytes object is created in the compiler and is loaded directly at execute
      time as a true constant (similar to loading bignum and float objects).
      This saves on allocating RAM and means that bytes objects can now be
      used when the memory manager is locked (eg in interrupts).
      The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this.
      Generated bytecode is slightly larger due to storing a pointer to the
      bytes object instead of the qstr identifier.
      Code size is reduced by about 60 bytes on Thumb2 architectures.
    • Damien George's avatar
  15. 23 Jun, 2015 2 commits
  16. 22 Jun, 2015 1 commit
  17. 20 Jun, 2015 1 commit
    • Damien George's avatar
      py: Use a wrapper to explicitly check self argument of builtin methods. · 06593fb0
      Damien George authored
      Previous to this patch a call such as list.append(1, 2) would lead to a
      seg fault.  This is because list.append is a builtin method and the first
      argument to such methods is always assumed to have the correct type.
      Now, when a builtin method is extracted like this it is wrapped in a
      checker object which checks the the type of the first argument before
      calling the builtin function.
      This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and
      is enabled by default.
      See issue #1216.
  18. 18 Jun, 2015 1 commit
  19. 13 Jun, 2015 3 commits
  20. 11 Jun, 2015 1 commit
    • Paul Sokolovsky's avatar
      py: Rebuild port if mpconfigport.mk changed (if any). · a19ba5fe
      Paul Sokolovsky authored
      mpconfigport.mk contains configuration options which affect the way
      MicroPython is linked. In this regard, it's "stronger" configuration
      dependency than even mpconfigport.h, so if we rebuild everything on
      mpconfigport.h change, we certianly should of that on mpconfigport.mk
      change too.
  21. 09 Jun, 2015 1 commit
  22. 08 Jun, 2015 1 commit
  23. 05 Jun, 2015 2 commits
  24. 04 Jun, 2015 3 commits