1. 27 Aug, 2014 2 commits
  2. 26 Aug, 2014 2 commits
    • Damien George's avatar
      py: Fix line number printing for file with 1 line. · b427d6ae
      Damien George authored
      With a file with 1 line (and an error on that line), used to show the
      line as number 0.  Now shows it correctly as line number 1.
      But, when line numbers are disabled, it now prints line number 1 for any
      line that has an error (instead of 0 as previously).  This might end up
      being confusing, but requires extra RAM and/or hack logic to make it
      print something special in the case of no line numbers.
    • Damien George's avatar
      py: Add dispatch for user defined ==, >, <=, >=. · 779794a6
      Damien George authored
      Addresses issue #827.
  3. 25 Aug, 2014 2 commits
    • Damien George's avatar
      stmhal: Make enable_irq and disable_irq inline functions. · e5cbb703
      Damien George authored
      These functions are generally 1 machine instruction, and are used in
      critical code, so makes sense to have them inline.
      Also leave these functions uninverted (ie 0 means enable, 1 means
      disable) and provide macro constants if you really need to distinguish
      the states.  This makes for smaller code as well (combined with
      Applied to teensy port as well.
    • Dave Hylands's avatar
      Add save/restore_irq · 9480138f
      Dave Hylands authored
      Factored irq functions into a separate file.
  4. 24 Aug, 2014 2 commits
  5. 22 Aug, 2014 3 commits
  6. 16 Aug, 2014 3 commits
  7. 15 Aug, 2014 4 commits
  8. 13 Aug, 2014 1 commit
  9. 12 Aug, 2014 6 commits
  10. 11 Aug, 2014 3 commits
  11. 10 Aug, 2014 6 commits
  12. 08 Aug, 2014 1 commit
    • 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).
  13. 07 Aug, 2014 1 commit
  14. 04 Aug, 2014 1 commit
  15. 31 Jul, 2014 3 commits
    • Damien George's avatar
      py: Improve encoding scheme for line-number to bytecode map. · 4747becc
      Damien George authored
      Reduces by about a factor of 10 on average the amount of RAM needed to
      store the line-number to bytecode map in the bytecode prelude.
      Using CPython3.4's stdlib for statistics: previously, an average of
      13 bytes were used per (bytecode offset, line-number offset) pair, and
      now with this improvement, that's down to 1.3 bytes on average.
      Large RAM usage before was due to some very large steps in line numbers,
      both from the start of the first line in a function way down in the
      file, and also functions that have big comments and/or big strings in
      them (both cases were significant).
      Although the savings are large on average for the CPython stdlib, it
      won't have such a big effect for small scripts used in embedded
      Addresses issue #648.
    • Damien George's avatar
      py: Improve handling of long-int overflow. · c9aa58e6
      Damien George authored
      This removes mpz_as_int, since that was a terrible function (it
      implemented saturating conversion).
      Use mpz_as_int_checked and mpz_as_uint_checked.  These now work
      correctly (they previously had wrong overflow checking, eg
      print(chr(10000000000000)) on 32-bit machine would incorrectly convert
      this large number to a small int).
    • Damien George's avatar
      py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself. · bb4c6f35
      Damien George authored
      Addresses issue #724.