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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy