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. Jul 31, 2017
  3. Feb 16, 2017
    • Damien George's avatar
      py: Add iter_buf to getiter type method. · ae8d8675
      Damien George authored
      Allows to iterate over the following without allocating on the heap:
      - tuple
      - list
      - string, bytes
      - bytearray, array
      - dict (not dict.keys, dict.values, dict.items)
      - set, frozenset
      
      Allows to call the following without heap memory:
      - all, any, min, max, sum
      
      TODO: still need to allocate stack memory in bytecode for iter_buf.
      ae8d8675
  4. Jan 13, 2016
  5. Jan 11, 2016
    • Damien George's avatar
      py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*. · 5b3f0b7f
      Damien George authored
      The first argument to the type.make_new method is naturally a uPy type,
      and all uses of this argument cast it directly to a pointer to a type
      structure.  So it makes sense to just have it a pointer to a type from
      the very beginning (and a const pointer at that).  This patch makes
      such a change, and removes all unnecessary casting to/from mp_obj_t.
      5b3f0b7f
    • Damien George's avatar
      py: Change type of .make_new and .call args: mp_uint_t becomes size_t. · a0c97814
      Damien George authored
      This patch changes the type signature of .make_new and .call object method
      slots to use size_t for n_args and n_kw (was mp_uint_t.  Makes code more
      efficient when mp_uint_t is larger than a machine word.  Doesn't affect
      ports when size_t and mp_uint_t have the same size.
      a0c97814
  6. Nov 29, 2015
    • Damien George's avatar
      py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR. · 999cedb9
      Damien George authored
      This allows the mp_obj_t type to be configured to something other than a
      pointer-sized primitive type.
      
      This patch also includes additional changes to allow the code to compile
      when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
      mp_uint_t, and various casts.
      999cedb9
  7. Sep 04, 2015
  8. Apr 06, 2015
  9. Jan 20, 2015
  10. Jan 01, 2015
  11. Aug 29, 2014
  12. Jul 03, 2014
  13. Jun 21, 2014
  14. Jun 19, 2014
  15. May 06, 2014
  16. May 03, 2014
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      Blanket wide to all .c and .h files.  Some files originating from ST are
      difficult to deal with (license wise) so it was left out of those.
      
      Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
      04b9147e
  17. Apr 17, 2014
  18. Mar 30, 2014
    • Damien George's avatar
      Rename rt_* to mp_*. · d17926db
      Damien George authored
      Mostly just a global search and replace.  Except rt_is_true which
      becomes mp_obj_is_true.
      
      Still would like to tidy up some of the names, but this will do for now.
      d17926db
  19. Mar 29, 2014
  20. Mar 26, 2014
  21. Mar 17, 2014
    • xbe's avatar
      py: Clean up includes. · efe34223
      xbe authored
      Remove unnecessary includes. Add includes that improve portability.
      efe34223
  22. Feb 15, 2014
    • Damien George's avatar
      Implement proper exception type hierarchy. · c5966128
      Damien George authored
      Each built-in exception is now a type, with base type BaseException.
      C exceptions are created by passing a pointer to the exception type to
      make an instance of.  When raising an exception from the VM, an
      instance is created automatically if an exception type is raised (as
      opposed to an exception instance).
      
      Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper.
      
      Handling of parse error changed to match new exceptions.
      
      mp_const_type renamed to mp_type_type for consistency.
      c5966128
    • Damien George's avatar
      Change mp_obj_type_t.name from const char * to qstr. · a71c83a1
      Damien George authored
      Ultimately all static strings should be qstr.  This entry in the type
      structure is only used for printing error messages (to tell the type of
      the bad argument), and printing objects that don't supply a .print method.
      a71c83a1
  23. Feb 12, 2014
  24. Jan 21, 2014
  25. Jan 18, 2014
    • Damien George's avatar
      Make VM stack grow upwards, and so no reversed args arrays. · 20006dbb
      Damien George authored
      Change state layout in VM so the stack starts at state[0] and grows
      upwards.  Locals are at the top end of the state and number downwards.
      This cleans up a lot of the interface connecting the VM to C: now all
      functions that take an array of Micro Python objects are in order (ie no
      longer in reverse).
      
      Also clean up C API with keyword arguments (call_n and call_n_kw
      replaced with single call method that takes keyword arguments).  And now
      make_new takes keyword arguments.
      
      emitnative.c has not yet been changed to comply with the new order of
      stack layout.
      20006dbb
  26. Jan 14, 2014
Loading