- Feb 19, 2019
-
-
Damien George authored
Q_GET_HASH may evaluate its argument more than once.
-
- Dec 15, 2018
-
-
Damien George authored
-
- Nov 29, 2017
-
-
Damien George authored
So long as the input qstr identifier is valid (below the maximum number of qstrs) the function will always return a valid pointer. This patch eliminates the "return 0" dead-code.
-
- Nov 01, 2017
-
-
Damien George authored
The technique of using alloca is how dotted import names are composed in mp_import_from and mp_builtin___import__, so use the same technique in the compiler. This puts less pressure on the heap (only the stack is used if the qstr already exists, and if it doesn't exist then the standard qstr block memory is used for the new qstr rather than a separate chunk of the heap) and reduces overall code size.
-
- Aug 15, 2017
-
-
Stefan Naumann authored
It enables all the DEBUG_printf outputs in the py/ source code.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Nov 02, 2016
-
-
Colin Hogben authored
In both parse.c and qstr.c, an internal chunking allocator tidies up by calling m_renew to shrink an allocated chunk to the size used, and assumes that the chunk will not move. However, when MICROPY_ENABLE_GC is false, m_renew calls the system realloc, which does not guarantee this behaviour. Environments where realloc may return a different pointer include: (1) mbed-os with MBED_HEAP_STATS_ENABLED (which adds a wrapper around malloc & friends; this is where I was hit by the bug); (2) valgrind on linux (how I diagnosed it). The fix is to call m_renew_maybe with allow_move=false.
-
- Sep 19, 2016
-
-
Damien George authored
qstrs are always null terminated so qstr_str will stay as part of the API.
-
- Jun 28, 2016
-
-
Damien George authored
There is no need since the GIL already makes gc and qstr operations atomic.
-
Damien George authored
-
- Jun 15, 2016
-
-
Paul Sokolovsky authored
It has more usages than just qstr extraction, for example, embedding (where people don't care about efficient predefined qstrs).
-
- Apr 19, 2016
-
-
Paul Sokolovsky authored
When there're C files to be (re)compiled, they're all passed first to preprocessor. QSTR references are extracted from preprocessed output and split per original C file. Then all available qstr files (including those generated previously) are catenated together. Only if the resulting content has changed, the output file is written (causing almost global rebuild to pick up potentially renumbered qstr's). Otherwise, it's not updated to not cause spurious rebuilds. Related make rules are split to minimize amount of commands executed in the interim case (when some C files were updated, but no qstrs were changed).
-
- Apr 13, 2016
-
-
Damien George authored
The config variable MICROPY_MODULE_FROZEN is now made of two separate parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY. This allows to have none, either or both of frozen strings and frozen mpy files (aka frozen bytecode).
-
- Dec 17, 2015
-
-
Damien George authored
-
- Nov 29, 2015
-
-
Damien George authored
-
- Oct 13, 2015
-
-
Damien George authored
-
- Jul 20, 2015
-
-
Damien George authored
This patch makes configurable, via MICROPY_QSTR_BYTES_IN_HASH, the number of bytes used for a qstr hash. It was originally fixed at 2 bytes, and now defaults to 2 bytes. Setting it to 1 byte will save ROM and RAM at a small expense of hash collisions.
-
- Jul 14, 2015
-
-
Damien George authored
Previous to this patch all interned strings lived in their own malloc'd chunk. On average this wastes N/2 bytes per interned string, where N is the number-of-bytes for a quanta of the memory allocator (16 bytes on 32 bit archs). With this patch interned strings are concatenated into the same malloc'd chunk when possible. Such chunks are enlarged inplace when possible, and shrunk to fit when a new chunk is needed. RAM savings with this patch are highly varied, but should always show an improvement (unless only 3 or 4 strings are interned). New version typically uses about 70% of previous memory for the qstr data, and can lead to savings of around 10% of total memory footprint of a running script. Costs about 120 bytes code size on Thumb2 archs (depends on how many calls to gc_realloc are made).
-
- Apr 16, 2015
-
-
Damien George authored
-
- Feb 10, 2015
-
-
Damien George authored
-
- Jan 16, 2015
-
-
Damien George authored
See issue #699.
-
- Jan 13, 2015
-
-
Damien George authored
Previously to this patch all constant string/bytes objects were interned by the compiler, and this lead to crashes when the qstr was too long (noticeable now that qstr length storage defaults to 1 byte). With this patch, long string/bytes objects are never interned, and are referenced directly as constant objects within generated code using load_const_obj.
-
- Jan 11, 2015
-
-
Damien George authored
This new config option sets how many fixed-number-of-bytes to use to store the length of each qstr. Previously this was hard coded to 2, but, as per issue #1056, this is considered overkill since no-one needs identifiers longer than 255 bytes. With this patch the number of bytes for the length is configurable, and defaults to 1 byte. The configuration option filters through to the makeqstrdata.py script. Code size savings going from 2 to 1 byte: - unix x64 down by 592 bytes - stmhal down by 1148 bytes - bare-arm down by 284 bytes Also has RAM savings, and will be slightly more efficient in execution.
-
Damien George authored
-
Damien George authored
-
- Jan 07, 2015
-
-
Damien George authored
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Oct 31, 2014
-
-
Damien George authored
gc.enable/disable are now the same as CPython: they just control whether automatic garbage collection is enabled or not. If disabled, you can still allocate heap memory, and initiate a manual collection.
-
- Oct 24, 2014
-
-
Damien George authored
In unix port, mem_info(1) now prints pretty GC alloc table.
-
- Oct 03, 2014
-
-
Damien George authored
This should pretty much resolve 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.
-
- Jun 11, 2014
-
-
Damien George authored
-
- May 25, 2014
-
-
Damien George authored
This removes need for some casts (at least, more than it adds need for new casts!).
-
- 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 17, 2014
-
-
Damien George authored
Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
-
- Apr 16, 2014
-
-
Andrew Scheller authored
The autogenerated header files have been moved about, and an extra include dir has been added, which means you can give a custom BUILD=newbuilddir option to make, and everything "just works" Also tidied up the way the different Makefiles build their include- directory flags
-
- Apr 13, 2014
-
-
Paul Sokolovsky authored
This feature was proposed with initial hashing RFC, and is prerequisite for seamless static str object definition.
-
- Mar 25, 2014
-
-
Damien George authored
-
- Feb 26, 2014
-
-
Damien George authored
-