summaryrefslogtreecommitdiff
path: root/ports/esp32/gccollect.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp32/gccollect.c')
-rw-r--r--ports/esp32/gccollect.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ports/esp32/gccollect.c b/ports/esp32/gccollect.c
index 6fa287de2..e16e8028a 100644
--- a/ports/esp32/gccollect.c
+++ b/ports/esp32/gccollect.c
@@ -80,3 +80,13 @@ void gc_collect(void) {
}
#endif
+
+#if MICROPY_GC_SPLIT_HEAP_AUTO
+
+// The largest new region that is available to become Python heap is the largest
+// free block in the ESP-IDF system heap.
+size_t gc_get_max_new_split(void) {
+ return heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT);
+}
+
+#endif