| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are 2 locations in parser, and 1 in compiler, where memory
allocation is not precise. In the parser it's the rule stack and result
stack, in the compiler it's the array for the identifiers in the current
scope. All other mallocs are exact (ie they don't allocate more than is
needed).
This patch adds tuning options (MP_ALLOC_*) to mpconfig.h for these 3
inexact allocations.
The inexact allocations in the parser should actually be close to
logarithmic: you need an exponentially larger script (absent pathological
cases) to use up more room on the rule and result stacks. As such, the
default allocation policy for these is now to start with a modest sized
stack, but grow only in small increments.
For the identifier arrays in the compiler, these now start out quite
small (4 entries, since most functions don't have that many ids), and
grow incrementally by 6 (since if you have more ids than 4, you probably
have quite a few more, but it wouldn't be exponentially more).
Partially addresses issue #560.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for
unix/windows ports. This makes it convenient to user uPy normally, but
easily get bytecode dump on the spot if needed, without constant recompiles
back and forth.
TODO: Add more useful debug output, adjust verbosity level on which
specifically bytecode dump happens.
|
| |
|
|
|
|
|
|
|
| |
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/.
|
|\
| |
| | |
Proposed license/copyright file header.
|
| | |
|
|\ \
| | |
| | |
| | | |
stinos-mingw-float-printf
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
By default mingw outputs 3 digits instead of the standard 2 so all float
tests using printf fail. Using setenv at the start of the program fixes this.
To accomodate calling platform specific initialization a
MICROPY_MAIN_INIT_FUNC macro is used which is called in mp_init()
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| |
| |
| |
| | |
This follows up 0a7e01ae3c529fddf79dc5c71bf7e43cff3f9fa0.
|
|\ \
| | |
| | | |
More relaxed parsing of preprocessed qstr header
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The original parsing would error out on any C declarations that are not typedefs
or extern variables. This limits what can go in mpconfig.h and mpconfigport.h,
as they are included in qstr.h. For instance even a function declaration would be
rejected and including system headers is a complete no-go.
That seems too limiting for a global config header, so makeqstrdata now
ignores everything that does not match a qstr definition.
|
|\ \ \
| | | |
| | | | |
py: Use <alloca.h> for alloca()
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
alloca() is declared in alloca.h which als happens to be included by stdlib.h.
On mingw however it resides in malloc.h only.
So if we include alloca.h directly, and add an alloca.h for mingw in it's port
directory we can get rid of the mingw-specific define to include malloc.h
and the other ports are happy as well.
|
|/ /
| |
| |
| |
| | |
Well, it is bound to "detailed error reporting", but that's closest what we
have now without creating new entities.
|
| |
| |
| |
| | |
Specifically, nlr.h does.
|
| | |
|
| | |
|
| |
| |
| |
| | |
TODO: Rename methods.
|
| |
| |
| |
| | |
This is ugly, just as expected.
|
|\ \
| | |
| | | |
Fix the builtin min() and max() functions (and add tests).
|
| | |
| | |
| | |
| | | |
Fixes #539
|
| | | |
|
| | | |
|
|/ / |
|
| | |
|
|/ |
|
|\
| |
| | |
Initial support for subclassing native types
|
| |
| |
| |
| |
| |
| |
| |
| | |
Biggest part of this support is refactoring mp_obj_class_lookup() to return
standard "bound member" pair (mp_obj_t[2]). Actual support of inherited
native methods is 3 lines then. Some inherited features may be not supported
yet (e.g. native class methods, native properties, etc., etc.). There may
be opportunities for further optimization too.
|
| | |
|
| |
| |
| |
| |
| |
| | |
This implements checking of base types, allocation and basic initialization,
and optimized support for special method lookups. Other features are not yet
supported.
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
And this is not good.
|
|
|
|
|
|
|
| |
Had choice of either interning or forcing full equality comparison, and
chose latter. See comments in mp_map_lookup.
Addresses issue #523.
|
|
|
|
| |
Addresses issue #526.
|
|
|
|
|
|
|
|
|
|
| |
Of course, keywords are turned into lexer tokens in the lexer, so will
never need to be interned (unless you do something like x="def").
As it is now, the following on pyboard makes no new qstrs:
import pyb
pyb.info()
|
|
|
|
|
|
| |
Also, clear up freed slots in containers.
As a follow up to 32bef315be8e56ad2d7f69223fe7b9606893b6ab.
|
|
|
|
| |
They either succeed or raise exception.
|
| |
|
| |
|
|
|
|
| |
It's the same as LOAD_CONST_STR.
|
|
|
|
|
| |
Remembering the last op is rarely needed, and when it is, can simply use
*save_ip.
|
|
|
|
| |
Messages are still explanatory, while taking a little less ROM.
|
|
|
|
|
|
|
|
| |
New way uses slightly less ROM and RAM, should be slightly faster, and,
most importantly, allows to catch the error "non-keyword arg following
keyword arg".
Addresses issue #466.
|