Commit Graph

19 Commits

Author SHA1 Message Date
Jeff Epler
a94301122a
Make natmods work again.
And put back our magic number, because our bytecode format differs
from upstream

drop btree & framebuf natmods, they had additional problems I didn't
want to fix right now.
2023-08-19 16:59:13 -05:00
Dan Halbert
0d4bc8c163 initial v1.19.1 merge; not compiled yet 2023-08-01 13:50:05 -04:00
hathach
fecc1bdedb
fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
Damien George
1f1afae622 examples/natmod/features3: Add example to test more natmod features.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-10 16:42:43 +10:00
Jeff Epler
adfa6ef019
Fix all natmod tests to run on x64
My testing sequence is

```
git clean -dxf examples
arch=x64; make -C examples/natmod/features1 ARCH=$arch && make -C examples/natmod/features2 ARCH=$arch && make -C examples/natmod/btree ARCH=$arch && make -C examples/natmod/framebuf ARCH=$arch && make -C examples/natmod/uheapq ARCH=$arch && make -C examples/natmod/urandom ARCH=$arch && make -C examples/natmod/ure ARCH=$arch && make -C examples/natmod/uzlib ARCH=$arch
(cd tests && ./run-natmodtests.py "$@" extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py)
```
2022-02-13 11:18:38 -06:00
stijn
51fd6c9777 extmod/ure: Use single function for match/search/sub.
Saves about 500 bytes on unix x64 and enables CPython-conform
usage of passing a re object to these functions.
2020-06-08 09:16:09 +02:00
Damien George
73c58150f5 extmod/modbtree: Retain reference to underlying stream so it's not GC'd.
For ports that have a system malloc which is not garbage collected (eg
unix, esp32), the stream object for the DB must be retained separately to
prevent it from being reclaimed by the MicroPython GC (because the
berkeley-db library uses malloc to allocate the DB structure which stores
the only reference to the stream).

Although in some cases the user code will explicitly retain a reference to
the underlying stream because it needs to call close() on it, this is not
always the case, eg in cases where the DB is intended to live forever.

Fixes issue #5940.
2020-05-02 16:08:04 +10:00
Jim Mussared
def76fe4d9 all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
Jim Mussared
c34e7b9d4c py/dynruntime.mk: Set MICROPY_ENABLE_DYNRUNTIME instead of per module.
So this setting could be used by other source files if needed.
2020-04-05 14:13:02 +10:00
Damien George
9c07c973c1 examples/natmod: Add .gitignore to ignore generated example .mpy files. 2020-03-03 12:54:17 +11:00
Damien George
69661f3343 all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-28 10:33:03 +11:00
Damien George
a3df152fef examples/natmod: Add very simple features0 example to compute factorial. 2019-12-19 17:06:27 +11:00
Damien George
ba84453f77 examples/natmod: Add urandom native module example. 2019-12-13 13:33:40 +11:00
Damien George
60c3c22a0d examples/natmod: Add features1 and features2 examples. 2019-12-12 20:15:28 +11:00
Damien George
42c1aed2bb examples/natmod: Add ure example. 2019-12-12 20:15:28 +11:00
Damien George
2a485e1084 examples/natmod: Add framebuf example. 2019-12-12 20:15:28 +11:00
Damien George
16e591e412 examples/natmod: Add uzlib example. 2019-12-12 20:15:28 +11:00
Damien George
83f9fb169e examples/natmod: Add uheapq example. 2019-12-12 20:15:28 +11:00
Damien George
37817ab4ba examples/natmod: Add btree example. 2019-12-12 20:15:28 +11:00