b6b39bff47
This commit makes gc_lock_depth have one counter per thread, instead of one global counter. This makes threads properly independent with respect to the GC, in particular threads can now independently lock the GC for themselves without locking it for other threads. It also means a given thread can run a hard IRQ without temporarily locking the GC for all other threads and potentially making them have MemoryError exceptions at random locations (this really only occurs on MCUs with multiple cores and no GIL, eg on the rp2 port). The commit also removes protection of the GC lock/unlock functions, which is no longer needed when the counter is per thread (and this also fixes the cas where a hard IRQ calling gc_lock() may stall waiting for the mutex). It also puts the check for `gc_lock_depth > 0` outside the GC mutex in gc_alloc, gc_realloc and gc_free, to potentially prevent a hard IRQ from waiting on a mutex if it does attempt to allocate heap memory (and putting the check outside the GC mutex is now safe now that there is a gc_lock_depth per thread). Signed-off-by: Damien George <damien@micropython.org> |
||
---|---|---|
.. | ||
asf4@d270f79aa1 | ||
axtls@43a6e6bd3b | ||
berkeley-db-1.xx@35aaec4418 | ||
btstack@c8b9823f68 | ||
cmsis/inc | ||
embed | ||
libc | ||
libffi@e9de7e35f2 | ||
libhydrogen@5c5d513093 | ||
libm | ||
libm_dbl | ||
littlefs | ||
lwip@159e31b689 | ||
mbedtls@1b6a24f759 | ||
mbedtls_errors | ||
memzip | ||
mp-readline | ||
mynewt-nimble@97ce3eacaa | ||
netutils | ||
nrfx@7a4c9d946c | ||
nxp_driver@b618cb1d52 | ||
oofatfs | ||
pico-sdk@fc10a97c38 | ||
stm32lib@302c52794d | ||
timeutils | ||
tinytest | ||
tinyusb@7b62c71dd5 | ||
upytesthelper | ||
utils | ||
README.md |
This directory contains standard, low-level C libraries with emphasis on being independent and efficient. They can be used by any port.