8000 stm32/mpconfigport.h: Remove malloc/free/realloc helper macros. · rlucia/micropython@781947a · GitHub
[go: up one dir, main page]

Skip to content

Commit 781947a

Browse files
committed
stm32/mpconfigport.h: Remove malloc/free/realloc helper macros.
These macros are unused, and they can conflict with other entities by the same name. If needed they can be provided as static inline functions, or just functions. Fixes issue micropython#4559.
1 parent 1556af1 commit 781947a

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

ports/stm32/mpconfigport.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,5 @@ static inline mp_uint_t disable_irq(void) {
365365
// We need an implementation of the log2 function which is not a macro
366366
#define MP_NEED_LOG2 (1)
367367

368-
// There is no classical C heap in bare-metal ports, only Python
369-
// garbage-collected heap. For completeness, emulate C heap via
370-
// GC heap. Note that MicroPython core never uses malloc() and friends,
371-
// so these defines are mostly to help extension module writers.
372-
#define malloc(n) m_malloc(n)
373-
#define free(p) m_free(p)
374-
#define realloc(p, n) m_realloc(p, n)
375-
376368
// We need to provide a declaration/definition of alloca()
377369
#include <alloca.h>

0 commit comments

Comments
 (0)
0