1. 20 Jul, 2015 8 commits
  2. 19 Jul, 2015 1 commit
  3. 18 Jul, 2015 1 commit
  4. 17 Jul, 2015 1 commit
  5. 16 Jul, 2015 1 commit
  6. 15 Jul, 2015 3 commits
  7. 14 Jul, 2015 3 commits
    • Dave Hylands's avatar
    • 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
    • Paul Sokolovsky's avatar
      unix: modsocket: Implement inet_pton() in preference of inet_aton(). · c48740e2
      Paul Sokolovsky authored
      inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible
      for other address families, but underlying libc inet_pton() function isn't
      really extensible (e.g., it doesn't return length of binary address, i.e. it's
      really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could
      extend it to support other addresses.
      c48740e2
  8. 13 Jul, 2015 1 commit
  9. 12 Jul, 2015 1 commit
    • Paul Sokolovsky's avatar
      unix: modsocket: Implement sendto(). · 3b83aeb4
      Paul Sokolovsky authored
      sendto() turns out to be mandatory function to work with UDP. It may seem
      that connect(addr) + send() would achieve the same effect, but what connect()
      appears to do is to set source address filter on a socket to its argument.
      Then everything falls apart: socket sends to a broad-/multi-cast address,
      but reply is sent from real peer address, which doesn't match filter set
      by connect(), so local socket never sees a reply.
      3b83aeb4
  10. 10 Jul, 2015 4 commits
  11. 09 Jul, 2015 2 commits
  12. 08 Jul, 2015 4 commits
  13. 07 Jul, 2015 6 commits
  14. 06 Jul, 2015 4 commits
    • Dave Hylands's avatar
      tools: Fix pydfu.py to work with old and new versions of PyUSB · c91727b7
      Dave Hylands authored
      Update pydfu.py to match with the version from openmv.
      
      I just updated the openmv version to work with both of the
      PyUSB 1.0.0.b1 and 1.0.0.b2
      
      See: https://github.com/walac/pyusb/blob/master/ReleaseNotes.rst
      c91727b7
    • 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
      character.
      
      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.
      9f76dcd6
    • 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.
      ef7dd8db
    • Paul Sokolovsky's avatar
      6ab8b63b