summaryrefslogtreecommitdiffstatshomepage
path: root/py/gc.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-03-02 17:32:13 +1100
committerJim Mussared <jim.mussared@gmail.com>2023-04-26 11:37:20 +1000
commit256f47e2f8348d08b53e3c69461cf07903b00367 (patch)
tree342d65b9f335dd86b48f4b69d1cc352556d42ba4 /py/gc.c
parentbc9ec1cf718361c1f361bb4ff6de3c660d84696d (diff)
downloadmicropython-256f47e2f8348d08b53e3c69461cf07903b00367.tar.gz
micropython-256f47e2f8348d08b53e3c69461cf07903b00367.zip
extmod/btstack: Fix indicate/notify queuing.
This adds a mechanism to track a pending notify/indicate operation that is deferred due to the send buffer being full. This uses a tracked alloc that is passed as the content arg to the callback. This replaces the previous mechanism that did this via the global pending op queue, shared with client read/write ops. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py/gc.c')
-rw-r--r--py/gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/gc.c b/py/gc.c
index ba5c569d50..ad3e110407 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -746,7 +746,9 @@ void *gc_alloc_with_finaliser(mp_uint_t n_bytes) {
// TODO: freeing here does not call finaliser
void gc_free(void *ptr) {
if (MP_STATE_THREAD(gc_lock_depth) > 0) {
- // TODO how to deal with this error?
+ // Cannot free while the GC is locked. However free is an optimisation
+ // to reclaim the memory immediately, this means it will now be left
+ // until the next collection.
return;
}