1. 26 Jul, 2016 1 commit
  2. 25 Jul, 2016 4 commits
  3. 24 Jul, 2016 2 commits
  4. 23 Jul, 2016 3 commits
  5. 22 Jul, 2016 11 commits
  6. 21 Jul, 2016 4 commits
  7. 20 Jul, 2016 5 commits
    • Dave Hylands's avatar
      py: Fix nlrthumb.c when DEBUG=1 is defined · 26b7d8a7
      Dave Hylands authored
      26b7d8a7
    • Paul Sokolovsky's avatar
      43963a8d
    • Paul Sokolovsky's avatar
    • Paul Sokolovsky's avatar
      py/gc: Implement GC running by allocation threshold. · 93e353e3
      Paul Sokolovsky authored
      Currently, MicroPython runs GC when it could not allocate a block of memory,
      which happens when heap is exhausted. However, that policy can't work well
      with "inifinity" heaps, e.g. backed by a virtual memory - there will be a
      lot of swap thrashing long before VM will be exhausted. Instead, in such
      cases "allocation threshold" policy is used: a GC is run after some number of
      allocations have been made. Details vary, for example, number or total amount
      of allocations can be used, threshold may be self-adjusting based on GC
      outcome, etc.
      
      This change implements a simple variant of such policy for MicroPython. Amount
      of allocated memory so far is used for threshold, to make it useful to typical
      finite-size, and small, heaps as used with MicroPython ports. And such GC policy
      is indeed useful for such types of heaps too, as it allows to better control
      fragmentation. For example, if a threshold is set to half size of heap, then
      for an application which usually makes big number of small allocations, that
      will (try to) keep half of heap memory in a nice defragmented state for an
      occasional large allocation.
      
      For an application which doesn't exhibit such behavior, there won't be any
      visible effects, except for GC running more frequently, which however may
      affect performance. To address this, the GC threshold is configurable, and
      by default is off so far. It's configured with gc.threshold(amount_in_bytes)
      call (can be queries without an argument).
      93e353e3
    • Paul Sokolovsky's avatar
  8. 17 Jul, 2016 1 commit
  9. 16 Jul, 2016 4 commits
  10. 14 Jul, 2016 2 commits
  11. 13 Jul, 2016 1 commit
    • Paul Sokolovsky's avatar
      py/stream: Implement 2- and 3-arg write() method as an extension to CPython. · ad9b9c76
      Paul Sokolovsky authored
      3-arg form:
      
      stream.write(data, offset, length)
      
      2-arg form:
      
      stream.write(data, length)
      
      These allow efficient buffer writing without incurring extra memory
      allocation for slicing or creating memoryview() object, what is
      important for low-memory ports.
      
      All arguments must be positional. It might be not so bad idea to standardize
      on 3-arg form, but 2-arg case would need check and raising an exception
      anyway then, so instead it was just made to work.
      ad9b9c76
  12. 12 Jul, 2016 2 commits