Skip to content
Snippets Groups Projects
  1. Jun 28, 2016
  2. May 12, 2016
  3. May 11, 2016
  4. Dec 27, 2015
    • Paul Sokolovsky's avatar
      py/gc: Improve mark/sweep debug output. · 3ea03a11
      Paul Sokolovsky authored
      Previously, mark operation weren't logged at all, while it's quite useful
      to see cascade of marks in case of over-marking (and in other cases too).
      Previously, sweep was logged for each block of object in memory, but that
      doesn't make much sense and just lead to longer output, harder to parse
      by a human. Instead, log sweep only once per object. This is similar to
      other memory manager operations, e.g. an object is allocated, then freed.
      Or object is allocated, then marked, otherwise swept (one log entry per
      operation, with the same memory address in each case).
      3ea03a11
  5. Dec 18, 2015
    • Damien George's avatar
      py/gc: When printing info, use %u instead of UINT_FMT for size_t args. · acaccb37
      Damien George authored
      Ideally we'd use %zu for size_t args, but that's unlikely to be supported
      by all runtimes, and we would then need to implement it in mp_printf.
      So simplest and most portable option is to use %u and cast the argument
      to uint(=unsigned int).
      
      Note: reason for the change is that UINT_FMT can be %llu (size suitable
      for mp_uint_t) which is wider than size_t and prints incorrect results.
      acaccb37
  6. Dec 17, 2015
  7. Dec 02, 2015
  8. Nov 29, 2015
  9. Nov 07, 2015
    • Dave Hylands's avatar
      py: Clear finalizer flag when calling gc_free. · 7f3c0d1e
      Dave Hylands authored
      Currently, the only place that clears the bit is in gc_collect.
      So if a block with a finalizer is allocated, and subsequently
      freed, and then the block is reallocated with no finalizer then
      the bit remains set.
      
      This could also be fixed by having gc_alloc clear the bit, but
      I'm pretty sure that free is called way less than alloc, so doing
      it in free is more efficient.
      7f3c0d1e
  10. Sep 04, 2015
  11. 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
  12. Apr 16, 2015
  13. Apr 03, 2015
  14. Feb 07, 2015
  15. Jan 12, 2015
  16. Jan 11, 2015
  17. Jan 08, 2015
  18. Jan 07, 2015
  19. Jan 01, 2015
  20. Nov 05, 2014
  21. Oct 31, 2014
  22. Oct 24, 2014
  23. Oct 23, 2014
  24. Oct 17, 2014
  25. Oct 16, 2014
  26. Oct 15, 2014
  27. Aug 28, 2014
    • Damien George's avatar
      py, gc: Further reduce heap fragmentation with new, faster gc alloc. · 516b09ef
      Damien George authored
      The heap allocation is now exactly as it was before the "faster gc
      alloc" patch, but it's still nearly as fast.  It is fixed by being
      careful to always update the "last free block" pointer whenever the heap
      changes (eg free or realloc).
      
      Tested on all tests by enabling EXTENSIVE_HEAP_PROFILING in py/gc.c:
      old and new allocator have exactly the same behaviour, just the new one
      is much faster.
      516b09ef
    • Damien George's avatar
      py: Reduce fragmentation of GC heap. · b796e3d8
      Damien George authored
      Recent speed up of GC allocation made the GC have a fragmented heap.
      This patch restores "original fragmentation behaviour" whilst still
      retaining relatively fast allocation.  This patch works because there is
      always going to be a single block allocated now and then, which advances
      the gc_last_free_atb_index pointer often enough so that the whole heap
      doesn't need scanning.
      
      Should address issue #836.
      b796e3d8
  28. Aug 22, 2014
    • Damien George's avatar
      py: Speed up GC allocation. · d5e7f6e3
      Damien George authored
      This simple patch gives a very significant speed up for memory allocation
      with the GC.
      
      Eg, on PYBv1.0:
      tests/basics/dict_del.py: 3.55 seconds -> 1.19 seconds
      tests/misc/rge_sm.py:     15.3 seconds -> 2.48 seconds
      d5e7f6e3
  29. Aug 08, 2014
    • Damien George's avatar
      py: Fix bug where GC finaliser table was not completely zeroed out. · a1d3ee37
      Damien George authored
      This was a nasty bug to track down.  It only had consequences when the
      heap size was just the right size to expose the rounding error in the
      calculation of the finaliser table size.  And, a script had to allocate
      a small (1 or 2 cell) object at the very end of the heap.  And, this
      object must not have a finaliser.  And, the initial state of the heap
      must have been all bits set to 1.  All these conspire on the pyboard,
      but only if your run the script fresh (so unused memory is all 1's),
      and if your script allocates a lot of small objects (eg 2-char strings
      that are not interned).
      a1d3ee37
  30. Jul 03, 2014
  31. Jul 01, 2014
  32. Jun 21, 2014
Loading