- Feb 12, 2019
-
-
Damien George authored
-
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.
-
- Aug 02, 2018
-
-
Damien George authored
DEBUG_printf and MICROPY_DEBUG_PRINTER is now used instead of normal printf, and a fault is fixed in mp_obj_class_lookup with debugging enabled; see issue #3999. Debugging can now be enabled on all ports including when nan-boxing is used.
-
- Dec 19, 2017
-
-
Damien George authored
-
- Dec 09, 2017
-
-
Paul Sokolovsky authored
-
- 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 31, 2017
-
-
Damien George authored
Maps are always allocated "statically" and (de)initialised via mp_map_init and mp_map_deinit.
-
Damien George authored
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Mar 03, 2017
-
-
Damien George authored
There were 2 bugs, now fixed by this patch: - after deleting an element the len of the dict did not decrease by 1 - after deleting an element searching through the dict could lead to a seg fault due to there being an MP_OBJ_SENTINEL in the ordered array
-
- Feb 08, 2017
-
-
Damien George authored
The internal map/set functions now use size_t exclusively for computing addresses. size_t is enough to reach all of available memory when computing addresses so is the right type to use. In particular, for nanbox builds it saves quite a bit of code size and RAM compared to the original use of mp_uint_t (which is 64-bits on nanbox builds).
-
- May 20, 2016
-
-
Damien George authored
Otherwise some compilers (eg without optimisation) will put this read-only data in RAM instead of ROM.
-
- Apr 15, 2016
-
-
Damien George authored
Small hash tables (eg those used in user class instances that only have a few members) now only use the minimum amount of memory necessary to hold the key/value pairs. This can reduce performance for instances that have many members (because then there are many reallocations/rehashings of the table), but helps to conserve memory. See issue #1760.
-
- Apr 01, 2016
-
-
Stephen Kyle authored
-
- Dec 31, 2015
-
-
Damien George authored
It's possible to have a fixed map that is properly hashed (ie not simply ordered).
-
- Dec 26, 2015
-
-
Damien George authored
Map indicies are most commonly a qstr, and adding a fast-path for hashing of a qstr increases overall performance of the runtime. On pyboard there is a 4% improvement in the pystone benchmark for a cost of 20 bytes of code size. It's about a 2% improvement on unix.
-
- Nov 20, 2015
-
-
Damien George authored
-
- Nov 19, 2015
-
-
Damien George authored
This change makes the code behave how it was supposed to work when first written. The avail_slot variable is set to the first free slot when looking for a key (which would come from deleting an entry). So it's more efficient (for subsequent lookups) to insert a new key into such a slot, rather than the very last slot that was searched.
-
- May 12, 2015
-
-
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__".
-
- Apr 04, 2015
-
-
Damien George authored
-
- Mar 20, 2015
-
-
Damien George authored
Addresses issue #1160.
-
Paul Sokolovsky authored
Given that there's already support for "fixed table" maps, which are essentially ordered maps, the implementation of OrderedDict just extends "fixed table" maps by adding an "is ordered" flag and add/remove operations, and reuses 95% of objdict code, just making methods tolerant to both dict and OrderedDict. Some things are missing so far, like CPython-compatible repr and comparison. OrderedDict is Disabled by default; enabled on unix and stmhal ports.
-
- Jan 16, 2015
-
-
Damien George authored
See issue #699.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 27, 2014
-
-
Damien George authored
This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully disable the builtin set object (when set to 0). This includes removing set constructor/comprehension from the grammar, the compiler and the emitters. Now, enabling set costs 8168 bytes on unix x64, and 3576 bytes on stmhal.
-
- Nov 27, 2014
-
-
Paul Sokolovsky authored
Useful when need to call kw-receiving functions without any keywords from C, etc.
-
- Nov 05, 2014
-
-
Damien George authored
-
- Aug 30, 2014
-
-
Damien George authored
Part of code cleanup, towards resolving issue #50.
-
- Jul 03, 2014
-
-
Damien George authored
See discussion in issue #50.
-
- Jun 21, 2014
-
-
Paul Sokolovsky authored
It defines types used by all other headers. Fixes #691.
-
- May 03, 2014
-
-
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/.
-
- Apr 28, 2014
-
-
Damien George authored
Had choice of either interning or forcing full equality comparison, and chose latter. See comments in mp_map_lookup. Addresses issue #523.
-
- Apr 07, 2014
-
-
Damien George authored
-
- Apr 06, 2014
-
-
Damien George authored
Seems that this fixes all set tests.
-
Paul Sokolovsky authored
Two things: 1) set flags in copy properly; make mp_map_init() not be too smart and do something with requested alloc size. Policy of using prime numbers for alloc size is high-level policy which should be applied at corresponding high levels. Low-level functions should just do what they're asked to, because they don't have enough context to be smarter than that. For example, munging with alloc size of course breaks dict copying (as changing sizes requires rehashing).
-
- Apr 05, 2014
-
-
Damien George authored
-
Damien George authored
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
-
Damien George authored
Hash table can now be completely full (ie now NULL entry) before a resize is triggered. Use sentinel value to indicate delete entry in the table.
-
Paul Sokolovsky authored
When searching next time, such entry should be just skipped, not terminate the search. It's known that marking techique is not efficient at the presense of many removes, but namespace usage should not require many deletes, and as for user dictionaries - well, open addressing map table with linear rehashing and load factor of ~1 is not particularly efficient at all ;-). TODO: May consider "shift other entries in cluster" approach as an alternative.
-
Paul Sokolovsky authored
-