Skip to content
Snippets Groups Projects
  1. 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
  2. Jul 19, 2015
  3. Jul 18, 2015
  4. Jul 17, 2015
  5. Jul 16, 2015
  6. Jul 15, 2015
  7. Jul 14, 2015
    • 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. Jul 13, 2015
  9. Jul 12, 2015
    • 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. Jul 10, 2015
  11. Jul 09, 2015
  12. Jul 08, 2015
  13. Jul 07, 2015
  14. Jul 06, 2015
  15. Jul 05, 2015
  16. Jul 04, 2015
Loading