- Feb 12, 2019
-
-
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.
-
- Feb 05, 2019
-
-
Paul Sokolovsky authored
Based on git history.
-
- Oct 22, 2018
-
-
Paul Sokolovsky authored
Configurable via MICROPY_PY_BUILTINS_STR_COUNT. Default is enabled. Disabled for bare-arm, minimal, unix-minimal and zephyr ports. Disabling it saves 408 bytes on x86.
-
- Feb 14, 2018
-
-
Damien George authored
This patch provides inline versions of the utf8 helper functions for the case when unicode is disabled (MICROPY_PY_BUILTINS_STR_UNICODE set to 0). This saves code size. The unichar_charlen function is also renamed to utf8_charlen to match the other utf8 helper functions, and the signature of this function is adjusted for consistency (const char* -> const byte*, mp_uint_t -> size_t).
-
- Nov 16, 2017
-
-
Damien George authored
This patch simplifies the str creation API to favour the common case of creating a str object that is not forced to be interned. To force interning of a new str the new mp_obj_new_str_via_qstr function is added, and should only be used if warranted. Apart from simplifying the mp_obj_new_str function (and making it have the same signature as mp_obj_new_bytes), this patch also reduces code size by a bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
-
- Oct 04, 2017
-
-
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.
-
- Aug 29, 2017
-
-
Damien George authored
The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
-
- Aug 13, 2017
-
-
Javier Candeira authored
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jun 15, 2017
-
-
Damien George authored
-
- Mar 23, 2017
-
-
Damien George authored
These values are used to compute memory addresses and so size_t is the more appropriate type to use.
-
- Feb 16, 2017
-
-
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.
-
Damien George authored
-
- Aug 07, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Default is disabled, enabled for unix port. Saves 600 bytes on x86.
-
- Jul 25, 2016
-
-
Paul Sokolovsky authored
Order out-of-bounds check, completion check, and increment in the right way.
-
Paul Sokolovsky authored
There's single str_index_to_ptr() function, called for both bytes and unicode objects, so should handle each properly.
-
- May 21, 2016
-
-
Dave Hylands authored
-
Paul Sokolovsky authored
Disabled by default, enabled in unix port. Need for this method easily pops up when working with text UI/reporting, and coding workalike manually again and again counter-productive.
-
- Jan 03, 2016
-
-
Damien George authored
Only types whose iterator instances still fit in 4 machine words have been changed to use the polymorphic iterator. Reduces Thumb2 arch code size by 264 bytes.
-
- Nov 29, 2015
-
-
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.
-
Damien George authored
-
- Oct 11, 2015
-
-
Paul Sokolovsky authored
-
- Sep 03, 2015
-
-
Damien George authored
-
- May 17, 2015
-
-
Damien George authored
Background: trying to make an amalgamation of all the code gave some errors with redefined types and inconsistent use of static.
-
- Apr 16, 2015
-
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- Apr 04, 2015
-
-
Damien George authored
-
- Apr 03, 2015
-
-
Paul Sokolovsky authored
splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
-
- Mar 19, 2015
-
-
Damien George authored
-
- Jan 28, 2015
-
-
Damien George authored
-
- Jan 23, 2015
-
-
Paul Sokolovsky authored
There was really weird warning (promoted to error) when building Windows port. Exact cause is still unknown, but it uncovered another issue: 8-bit and unicode str_make_new implementations should be mutually exclusive, and not built at the same time. What we had is that bytes_decode() pulled 8-bit str_make_new() even for unicode build.
-
Paul Sokolovsky authored
To somewhat unbreak -DSTATIC="" compile.
-
- Jan 21, 2015
-
-
Damien George authored
This patch allows to reuse vstr memory when creating str/bytes object. This improves memory usage. Also saves code ROM: 128 bytes on stmhal, 92 bytes on bare-arm, and 88 bytes on unix x64.
-
- Jan 20, 2015
-
-
Damien George authored
See issue #699.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Oct 30, 2014
-
-
Paul Sokolovsky authored
Original motivation is to support converting bytearrays, but easier to just support buffer protocol at all.
-
- Sep 25, 2014
-
-
Damien George authored
The JSON specs are relatively flexible and allow us to use one function to print strings, be they ascii, bytes or utf-8 encoded.
-
- Sep 17, 2014
-
-
Damien George authored
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
-
- Aug 30, 2014
-
-
Damien George authored
Part of code cleanup, working towards resolving issue #50.
-
- Aug 29, 2014
-
-
Damien George authored
Addressing issue #50, still some way to go yet.
-