summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMatt Brejza <mbrejza@gmail.com>2016-07-15 00:13:07 +0100
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-30 21:24:35 +0300
commitafd4909a0f291c83aa8174921f78e1f7dde2919f (patch)
tree72c2cf7b5de41b43ff68a3bcab9580b2dc426314
parent37b143ce9ef761f4f0648bae447617f019fc34e1 (diff)
downloadmicropython-afd4909a0f291c83aa8174921f78e1f7dde2919f.tar.gz
micropython-afd4909a0f291c83aa8174921f78e1f7dde2919f.zip
stmhal: fixing malloc when used with external libraries
-rw-r--r--stmhal/mpconfigport.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h
index 29e4bd8d87..c2a2cbc1f1 100644
--- a/stmhal/mpconfigport.h
+++ b/stmhal/mpconfigport.h
@@ -235,9 +235,9 @@ static inline mp_uint_t disable_irq(void) {
// 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
+#define malloc(n) m_malloc(n)
+#define free(p) m_free(p)
+#define realloc(p, n) m_realloc(p, n)
// see stm32f4XX_hal_conf.h USE_USB_FS & USE_USB_HS
// at the moment only USB_FS is supported