summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
AgeCommit message (Collapse)Author
2014-05-07stream: Make non-blcoking stream support configurable.Paul Sokolovsky
Enable only on unix. To avoid unpleasant surprises with error codes.
2014-05-06modgc: Add new module for GC-related functionality.Paul Sokolovsky
2014-05-05py: Turn down amount of RAM parser and compiler use.Damien George
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.
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-05-01py: Add tentative scheme for error messages configuration.Paul Sokolovsky
2014-04-30py: Abstract no-return attribute for functions a bit.Paul Sokolovsky
2014-04-26py: Make collections module configurable, enabled by default.Damien George
2014-04-25py: Add MICROPY_ENABLE_DOC_STRING, disabled by default.Damien George
Also add a few STATIC's to some compile functions that should have them. Addresses issue #521.
2014-04-17py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.Damien George
On stmhal, computed gotos make the binary about 1k bigger, but makes it run faster, and we have the room, so why not. All tests pass on pyboard using computed gotos.
2014-04-17py: Add cmath module, for complex math. Disabled by default.Damien George
Not all functions implemented. Not enabled on pyboard.
2014-04-17py: Enable builtin 'property' by default.Damien George
2014-04-15Move entry_table to separated header file.AZ Huang
2014-04-14Merge pull request #479 from lurch/patch-1Damien George
Don't allow both ENDIANNESSes to be set
2014-04-14Make USE_COMPUTED_GOTO a config option in mpconfig.h.Damien George
Disabled by default. Enabled in unix port.
2014-04-14Don't allow both ENDIANNESSes to be setAndrew Scheller
See discussion on https://github.com/micropython/micropython/commit/2da81fa80c4cd965f05ad237d81d9764322fde20 Explicitly set `MP_ENDIANNESS_LITTLE` because that's the #define that is used in code elsewhere.
2014-04-13py: Add property object, with basic functionality.Damien George
Enabled by MICROPY_ENABLE_PROPERTY.
2014-04-13stmhal: Update for static mod sys.Paul Sokolovsky
2014-04-13py, unix: Convert sys module to static representation.Paul Sokolovsky
2014-04-11mpconfig.h: Add basic support for target endianness configuration.Paul Sokolovsky
A specific target can define either MP_ENDIANNESS_LITTLE or MP_ENDIANNESS_BIG to 1. Default is MP_ENDIANNESS_LITTLE. TODO: Autodetect based on compiler predefined macros?
2014-04-10py: Add simple way of looking up constants in compiler.Damien George
Working towards trying to support compile-time constants (see discussion in issue #227), this patch allows the compiler to look inside arbitrary uPy objects at compile time. The objects to search are given by the macro MICROPY_EXTRA_CONSTANTS (so they must be constant/ROM objects), and the constant folding occures on forms base.attr (both base and attr must be id's). It works, but it breaks strict CPython compatibility, since the lookup will succeed even without importing the namespace.
2014-04-10py: Start implementing "struct" module.Paul Sokolovsky
Only calcsize() and unpack() functions provided so far, for little-endian byte order. Format strings don't support repition spec (like "2b3i"). Unfortunately, dealing with all the various binary type sizes and alignments will lead to quite a bloated "binary" helper functions - if optimizing for speed. Need to think if using dynamic parametrized algos makes more sense.
2014-04-05Improve GC finalisation code; add option to disable it.Damien George
2014-04-03py: Add "io" module.Paul Sokolovsky
So far just includes "open" function, which should be supplied by a port. TODO: Make the module #ifdef'ed.
2014-03-25Proper support for registering builtin modules in ROM.Damien George
Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].
2014-03-08Implement ROMable modules. Add math module.Damien George
mp_module_obj_t can now be put in ROM. Configuration of float type is now similar to longint: can now choose none, float or double as the implementation. math module has basic math functions. For STM port, these are not yet implemented (they are just stub functions).
2014-02-22Add arbitrary precision integer support.Damien George
Some functionality is still missing (eg and, or, bit shift), and some things are buggy (eg subtract).
2014-02-15Implement proper exception type hierarchy.Damien George
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.
2014-02-14Allow ports to define statically builtin functions.Paul Sokolovsky
Convert unix open() to such.
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.Paul Sokolovsky
Some tools do not support local/static symbols (one example is GNU ld map file). Exposing all functions will allow to do detailed size comparisons, etc. Also, added bunch of statics where they were missing, and replaced few identity functions with global mp_identity().
2014-02-06Implement fixed buffer vstrs; use them for import path.Damien George
2014-01-29py: Add compile option to enable/disable source line numbers.Damien George
2014-01-19py: Add module/function/class name to exceptions.Damien George
Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
2014-01-16Add empty "micropython" module to allow more seamless CPython portability.Paul Sokolovsky
Implicit "micropython" module contains (at least) codegeneration decorators. Make it explicit, so an app could have "import micropython". On MicroPython, that will be no-op. On CPython, that will give a chance to have a module with placeholder decorators.
2014-01-13Cleanup built-ins, and fix some compiler warnings/errors.Damien George
2014-01-12Add framework to support alternative implementations of long int Python type.Paul Sokolovsky
2014-01-12Add WORD_MSBIT_HIGH define - machine_int_t with the highest bit set.Paul Sokolovsky
2014-01-12Move BITS_PER_BYTE, BITS_PER_WORD to mpconfig.h for reuse.Paul Sokolovsky
2014-01-07Factor and simplify Makefile's and mpconfig, part 2.Damien George
2014-01-07Factor and simplify Makefile's and mpconfig.Damien George
2014-01-04Enable slice support in config.Paul Sokolovsky
2014-01-04Move INT_FMT, etc. declaration into global mpconfig.h .Paul Sokolovsky
This in particular makes it available for stm port.
2014-01-03Rename default config file to mpconfig.h, and port's to mpconfigport.h.Paul Sokolovsky
mpconfig.h will automatically pull mpconfigport.h.