Skip to content
Snippets Groups Projects
  1. Feb 12, 2019
    • Damien George's avatar
      py: Downcase all MP_OBJ_IS_xxx macros to make a more consistent C API. · eee1e884
      Damien George authored
      These macros could in principle be (inline) functions so it makes sense to
      have them lower case, to match the other C API functions.
      
      The remaining macros that are upper case are:
      - MP_OBJ_TO_PTR, MP_OBJ_FROM_PTR
      - MP_OBJ_NEW_SMALL_INT, MP_OBJ_SMALL_INT_VALUE
      - MP_OBJ_NEW_QSTR, MP_OBJ_QSTR_VALUE
      - MP_OBJ_FUN_MAKE_SIG
      - MP_DECLARE_CONST_xxx
      - MP_DEFINE_CONST_xxx
      
      These must remain macros because they are used when defining const data (at
      least, MP_OBJ_NEW_SMALL_INT is so it makes sense to have
      MP_OBJ_SMALL_INT_VALUE also a macro).
      
      For those macros that have been made lower case, compatibility macros are
      provided for the old names so that users do not need to change their code
      immediately.
      eee1e884
  2. Sep 20, 2018
  3. Apr 04, 2018
  4. Dec 08, 2017
  5. Oct 04, 2017
    • Damien George's avatar
      all: Remove inclusion of internal py header files. · a3dc1b19
      Damien George authored
      Header files that are considered internal to the py core and should not
      normally be included directly are:
          py/nlr.h - internal nlr configuration and declarations
          py/bc0.h - contains bytecode macro definitions
          py/runtime0.h - contains basic runtime enums
      
      Instead, the top-level header files to include are one of:
          py/obj.h - includes runtime0.h and defines everything to use the
              mp_obj_t type
          py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
              and defines everything to use the general runtime support functions
      
      Additional, specific headers (eg py/objlist.h) can be included if needed.
      a3dc1b19
  6. Sep 17, 2017
    • Paul Sokolovsky's avatar
      py/modbuiltins: Implement abs() by dispatching to MP_UNARY_OP_ABS. · 9dce823c
      Paul Sokolovsky authored
      This allows user classes to implement __abs__ special method, and saves
      code size (104 bytes for x86_64), even though during refactor, an issue
      was fixed and few optimizations were made:
      
      * abs() of minimum (negative) small int value is calculated properly.
      * objint_longlong and objint_mpz avoid allocating new object is the
        argument is already non-negative.
      9dce823c
  7. Aug 29, 2017
  8. Jul 31, 2017
  9. Jul 25, 2017
  10. Jun 15, 2017
  11. Apr 30, 2017
    • stijn's avatar
      py: Cleanup use of global DEBUG preprocessor definition · 2f0ce2a6
      stijn authored
      The standard preprocessor definition to differentiate debug and non-debug
      builds is NDEBUG, not DEBUG, so don't rely on the latter:
      - just delete the use of it in objint_longlong.c as it has been stale code
        for years anyway (since commit [c4029e50]): SUFFIX isn't used anywhere.
      - replace DEBUG with MICROPY_DEBUG_NLR in nlr.h: it is rarely used anymore
        so can be off by default
      2f0ce2a6
  12. Apr 04, 2017
  13. Mar 09, 2017
  14. Feb 16, 2017
  15. Jan 21, 2017
  16. Dec 21, 2016
  17. Oct 11, 2016
  18. Mar 10, 2016
  19. Jan 07, 2016
  20. Nov 08, 2015
  21. Oct 11, 2015
  22. May 12, 2015
    • Damien George's avatar
      py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function. · c2a4e4ef
      Damien George authored
      Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
      the operator argument.  Hashing for int, str and bytes still go via
      fast-path in mp_unary_op since they are the most common objects which
      need to be hashed.
      
      This lead to quite a bit of code cleanup, and should be more efficient
      if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
      x86.
      
      The only loss is that the error message "unhashable type" is now the
      more generic "unsupported type for __hash__".
      c2a4e4ef
  23. Apr 25, 2015
  24. Mar 14, 2015
  25. Jan 24, 2015
  26. Jan 01, 2015
  27. Dec 29, 2014
    • Paul Sokolovsky's avatar
      py: Partially fix float to int conversion. · 12033df5
      Paul Sokolovsky authored
      This fixes conversion when float type has more mantissa bits than small int,
      and float value has small exponent. This is for example the case of 32-bit
      platform using doubles, and converting value of time.time(). Conversion of
      floats with larg exponnet is still not handled correctly.
      12033df5
  28. Dec 05, 2014
  29. Sep 10, 2014
  30. Sep 06, 2014
  31. Aug 29, 2014
  32. Jul 24, 2014
  33. Jul 03, 2014
  34. Jun 01, 2014
    • Damien George's avatar
      Rename bultins config variables to MICROPY_PY_BUILTINS_*. · fb510b3b
      Damien George authored
      This renames:
      MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
      MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
      MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
      MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
      
      See issue #35 for discussion.
      fb510b3b
  35. May 28, 2014
  36. May 21, 2014
  37. May 17, 2014
Loading