8000 stmhal: fixing malloc when used with external libraries · sparkfun/circuitpython@afd4909 · GitHub
[go: up one dir, main page]

Skip to content

Commit afd4909

Browse files
mattbrejzapfalcon
authored andcommitted
stmhal: fixing malloc when used with external libraries
1 parent 37b143c commit afd4909

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stmhal/mpconfigport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ static inline mp_uint_t disable_irq(void) {
235235
// garbage-collected heap. For completeness, emulate C heap via
236236
// GC heap. Note that MicroPython core never uses malloc() and friends,
237237
// so these defines are mostly to help extension module writers.
238-
#define malloc gc_alloc
239-
#define free gc_free
240-
#define realloc gc_realloc
238+
#define malloc(n) m_malloc(n)
239+
#define free(p) m_free(p)
240+
#define realloc(p, n) m_realloc(p, n)
241241

242242
// see stm32f4XX_hal_conf.h USE_USB_FS & USE_USB_HS
243243
// at the moment only USB_FS is supported

0 commit comments

Comments
 (0)
0