Commit Graph

13 Commits

Author SHA1 Message Date
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