- Jul 24, 2016
-
-
Paul Sokolovsky authored
-
- Jul 23, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
The idea behind decrease is: bytecode and other static data is also kept on heap, and can easily become half of heap, then setting threshold to half of heap will have null effect - GC will happen on complete heap exhaustion like before. But exactly in such config maintaining heap defragmented is very important, so lower threshold to accommodate that.
-
- Jul 22, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Otherwise, on bare-metal/RTOS systems can lead to resource leaks.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Should keep good chunk of heap unfragmented, if a user application allows that at all.
-
Paul Sokolovsky authored
Because they may use dupterm functionality (e.g. WebREPL running on boot).
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
stijn authored
This is a fix for https://github.com/micropython/micropython/issues/2209: by default a file created using open() uses text translation mode so writing \n to it will result in the file having \r\n. This is obviously problematic for binary .mpy files, so provide functions for setting the open mode and use binary mode in mpy-cross' main().
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
This may produce a warning, depending on MicroPython configuration.
-
- Jul 21, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Also, fix a warning text (remove "duplicate" BytesWarning).
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Something like: if foo == "bar": will be always false if foo is b"bar". In CPython, warning is issued if interpreter is started as "python3 -b". In MicroPython, MICROPY_PY_STR_BYTES_CMP_WARN setting controls it.
-
- Jul 20, 2016
-
-
Dave Hylands authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Currently, MicroPython runs GC when it could not allocate a block of memory, which happens when heap is exhausted. However, that policy can't work well with "inifinity" heaps, e.g. backed by a virtual memory - there will be a lot of swap thrashing long before VM will be exhausted. Instead, in such cases "allocation threshold" policy is used: a GC is run after some number of allocations have been made. Details vary, for example, number or total amount of allocations can be used, threshold may be self-adjusting based on GC outcome, etc. This change implements a simple variant of such policy for MicroPython. Amount of allocated memory so far is used for threshold, to make it useful to typical finite-size, and small, heaps as used with MicroPython ports. And such GC policy is indeed useful for such types of heaps too, as it allows to better control fragmentation. For example, if a threshold is set to half size of heap, then for an application which usually makes big number of small allocations, that will (try to) keep half of heap memory in a nice defragmented state for an occasional large allocation. For an application which doesn't exhibit such behavior, there won't be any visible effects, except for GC running more frequently, which however may affect performance. To address this, the GC threshold is configurable, and by default is off so far. It's configured with gc.threshold(amount_in_bytes) call (can be queries without an argument).
-
Paul Sokolovsky authored
-
- Jul 17, 2016
-
-
Paul Sokolovsky authored
-
- Jul 16, 2016
-
-
Paul Sokolovsky authored
Allows to build the library variant for other ports in parallel.
-
Paul Sokolovsky authored
Allows to build the library variant for other archs in parallel.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Shares the code with remove() method due to the same underlying f_unlink() FatFs operation.
-
- Jul 14, 2016
-
-
Paul Sokolovsky authored
Accepts only value of True.
-
Paul Sokolovsky authored
-
- Jul 13, 2016
-
-
Paul Sokolovsky authored
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.
-
- Jul 12, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Make variable MICROPY_SSL_AXTLS=1 should be defined to activate modussl_axtls and link with -laxtls.
-
Paul Sokolovsky authored
-
- Jul 11, 2016
-
-
Damien George authored
Otherwise gcc 6.1.1 raises a misleading-indentation error.
-
Damien George authored
The minimum thread stack size is set by pthreads (16k bytes) so we must use that value for our minimum. The stack limit check is also adjusted to work correctly for 32-bit builds.
-
Paul Sokolovsky authored
-
Damien George authored
-
Anton Sokolchenko authored
-