summaryrefslogtreecommitdiffstatshomepage
path: root/py/modgc.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/modgc.c')
-rw-r--r--py/modgc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/modgc.c b/py/modgc.c
index 03b520b949..03a41358c3 100644
--- a/py/modgc.c
+++ b/py/modgc.c
@@ -37,9 +37,15 @@
#if MICROPY_PY_GC && MICROPY_ENABLE_GC
+extern uint gc_collected;
+
STATIC mp_obj_t py_gc_collect(void) {
gc_collect();
+#if MICROPY_PY_GC_COLLECT_RETVAL
+ return MP_OBJ_NEW_SMALL_INT(gc_collected);
+#else
return mp_const_none;
+#endif
}
MP_DEFINE_CONST_FUN_OBJ_0(gc_collect_obj, py_gc_collect);