summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2016-07-14py/stream: Implement 2- and 3-arg write() method as an extension to CPython.Paul Sokolovsky
3-arg form: stream.write(data, offset, length) 2-arg form: stream.write(data, length) These allow efficient buffer writing without incurring extra memory allocation for slicing or creating memoryview() object, what is important for low-memory ports. All arguments must be positional. It might be not so bad idea to standardize on 3-arg form, but 2-arg case would need check and raising an exception anyway then, so instead it was just made to work.
2016-07-13extmod/modussl_axtls: Further changes to allow alternative SSL modules.Paul Sokolovsky
Make variable MICROPY_SSL_AXTLS=1 should be defined to activate modussl_axtls and link with -laxtls.
2016-07-13extmod/modussl: Rename to modussl_axtls.c, to allow impl using other SSL libs.Paul Sokolovsky
2016-07-11py/nlrx64.S: Prefix mp_thread_get_state with an underscore on Mac.Damien George
2016-07-11qemu-arm: Enable gcc LTO option for nlrthumb.cDaniel Tralamazza
LTO can't "see" inside naked functions, but we can mark `nlr_push_tail` as used.
2016-07-06py/objarray: Split out header to allow direct access to object.Paul Sokolovsky
This follows source code/header file organization similar to few other objects, and intended to be used only is special cases, where efficiency/ simplicity matters.
2016-07-04extmod/moduos_dupterm: Reserve buffer bytearray object for dupterm.Paul Sokolovsky
Allocating it for each read/write operation is a memory fragmentation hazard.
2016-07-02py/mpconfig.h: Mention MICROPY_PY_BTREE config option.Paul Sokolovsky
However, as it requires linking with external libraries, it actually should be ste on Makefile level.
2016-07-02py/builtinimport: Disable "imported as namespace package" warning.Paul Sokolovsky
Namespace packages are natural part of Python3, CPython3 doesn't have such warning, it made sense only from point of view of Python2 legacy.
2016-07-01py/gc: Calculate (and report) maximum contiguous free block size.Paul Sokolovsky
Just as maximum allocated block size, it's reported in allocation units (not bytes).
2016-06-30py/gc: Be sure to count last allocated block at heap end in stats.Paul Sokolovsky
Previously, if there was chain of allocated blocks ending with the last block of heap, it wasn't included in number of 1/2-block or max block size stats.
2016-06-28py/mpthread: Include mpstate.h when defining GIL macros.Damien George
2016-06-28py/nlrsetjmp: Update to take into account new location of nlr_top.Damien George
It's now accessed via the MP_STATE_THREAD macro.
2016-06-28py/nlrthumb: Convert NLR thumb funcs from asm to C with inline-asm.Damien George
Now only the bits that really need to be written in assembler are written in it, otherwise C is used. This means that the assembler code no longer needs to know about the global state structure which makes it much easier to maintain.
2016-06-28py/modthread: Allow to properly set the stack limit of a thread.Damien George
We rely on the port setting and adjusting the stack size so there is enough room to recover from hitting the stack limit.
2016-06-28py/mpthread.h: Move GIL macros outside MICROPY_PY_THREAD block.Damien George
The GIL macros are needed even if threading is not enabled.
2016-06-28py/modthread: Make Lock objects work when GIL is enabled.Damien George
2016-06-28py: Don't use gc or qstr mutex when the GIL is enabled.Damien George
There is no need since the GIL already makes gc and qstr operations atomic.
2016-06-28py: Implement a simple global interpreter lock.Damien George
This makes the VM/runtime thread safe, at the cost of not being able to run code in parallel.
2016-06-28py: Make interning of qstrs thread safe.Damien George
2016-06-28py/gc: Fix GC+thread bug where ptr gets lost because it's not computed.Damien George
GC_EXIT() can cause a pending thread (waiting on the mutex) to be scheduled right away. This other thread may trigger a garbage collection. If the pointer to the newly-allocated block (allocated by the original thread) is not computed before the switch (so it's just left as a block number) then the block will be wrongly reclaimed. This patch makes sure the pointer is computed before allowing any thread switch to occur.
2016-06-28py/modthread: Call mp_thread_start/mp_thread_finish around threads.Damien George
So the underlying thread implementation can do any necessary bookkeeping.
2016-06-28py/modthread: Be more careful with root pointers when creating a thread.Damien George
2016-06-28py/gc: Fix 2 cases of concurrent access to ATB and FTB.Damien George
2016-06-28py/modthread: Satisfy unused-args warning.Damien George
2016-06-28py/gc: Make memory manager and garbage collector thread safe.Damien George
By using a single, global mutex, all memory-related functions (alloc, free, realloc, collect, etc) are made thread safe. This means that only one thread can be in such a function at any one time.
2016-06-28py/modthread: Add with-context capabilities to lock object.Damien George
2016-06-28py/modthread: Implement lock object, for creating a mutex.Damien George
2016-06-28py/modthread: Add exit() function.Damien George
Simply raises the SystemExit exception.
2016-06-28py/modthread: Add stack_size() function.Damien George
2016-06-28py/modthread: Properly cast concrete exception pointer to an object.Damien George
2016-06-28py: Add basic _thread module, with ability to start a new thread.Damien George
2016-06-28py: Add MP_STATE_THREAD to hold state specific to a given thread.Damien George
2016-06-19py/objtype: Inherit protocol vtable from base class only if it exists.Paul Sokolovsky
2016-06-19py/mphal.h: If virtpin API is used, automagically include its header.Paul Sokolovsky
2016-06-19py/objtype: instance: Inherit protocol vtable from a base class.Paul Sokolovsky
This allows to define an abstract base class which would translate C-level protocol to Python method calls, and any subclass inheriting from it will support this feature. This in particular actually enables recently introduced machine.PinBase class.
2016-06-18extmod/machine_pinbase: Implementation of PinBase class.Paul Sokolovsky
Allows to translate C-level pin API to Python-level pin API. In other words, allows to implement a pin class and Python which will be usable for efficient C-coded algorithms, like bitbanging SPI/I2C, time_pulse, etc.
2016-06-18all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
2016-06-16py: Rename __QSTR_EXTRACT flag to NO_QSTR.Paul Sokolovsky
It has more usages than just qstr extraction, for example, embedding (where people don't care about efficient predefined qstrs).
2016-06-16py/mkrules.mk: Define "lib" outside conditional block.Paul Sokolovsky
"lib" happened to be defined inside block conditional on $(PROG).
2016-06-16py/makeqstrdefs.py: Remove restriction that source path can't be absolute.Paul Sokolovsky
That's arbitrary restriction, in case of embedding, a source file path may be absolute. For the purpose of filtering out system includes, checking for ".c" suffix is enough.
2016-06-15py/mpconfig.h: MP_NOINLINE is universally useful, move from unix port.Paul Sokolovsky
2016-06-15py: Support to build berkeley db 1.85 and "btree" module.Paul Sokolovsky
2016-06-12py/objdict: Implemented OrderedDict equality check.Mark Anthony Palomer
2016-06-06py/parse: Treat constants that start with underscore as private.Damien George
Assignments of the form "_id = const(value)" are treated as private (following a similar CPython convention) and code is no longer emitted for the assignment to a global variable. See issue #2111.
2016-05-31extmod/machine: Add MICROPY_PY_MACHINE_PULSE config for time_pulse_us.Damien George
Since not all ports that enable the machine module have the pin HAL functions.
2016-05-31extmod: Add machine time_pulse_us function (at C and Python level).Damien George
The C implementation is taken from the DHT driver.
2016-05-28py/modstruct: Allow to have "0s" in struct format.Damien George
2016-05-28py/moduerrno: Add ECONNREFUSED, one of frequent networking errors.Paul Sokolovsky
2016-05-27extmod/virtpin: Initial implementation of open-ended C-level Pin interface.Paul Sokolovsky
Using usual method of virtual method tables. Single virtual method, ioctl, is defined currently for all operations. This universal and extensible vtable-based method is also defined as a default MPHAL GPIO implementation, but a specific port may override it with its own implementation (e.g. close-ended, but very efficient, e.g. avoiding virtual method dispatch).