summaryrefslogtreecommitdiffstatshomepage
path: root/stm/mpconfigport.h
diff options
context:
space:
mode:
Diffstat (limited to 'stm/mpconfigport.h')
-rw-r--r--stm/mpconfigport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/stm/mpconfigport.h b/stm/mpconfigport.h
index fd7af29d27..1d79243f9b 100644
--- a/stm/mpconfigport.h
+++ b/stm/mpconfigport.h
@@ -21,6 +21,14 @@ typedef float machine_float_t;
machine_float_t machine_sqrt(machine_float_t x);
+// There is no classical C heap in bare-metal ports, only Python
+// garbage-collected heap. For completeness, emulate C heap via
+// GC heap. Note that MicroPython core never uses malloc() and friends,
+// so these defines are mostly to help extension module writers.
+#define malloc gc_alloc
+#define free gc_free
+#define realloc gc_realloc
+
// board specific definitions
// choose 1 of these boards