From 0313756ea38d71cfce21a0a905f4fc43ac68d197 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 27 Nov 2015 10:15:46 +1000 Subject: Add ability to emulate malloc() and free() to prevent nasty hard to find link errors from C library routines that need malloc --- src/gos/gos_x_heap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gos/gos_x_heap.c') diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c index cd78f403..7e79d1c6 100644 --- a/src/gos/gos_x_heap.c +++ b/src/gos/gos_x_heap.c @@ -194,3 +194,14 @@ #endif #endif /* GOS_NEED_X_HEAP */ + +#if GFX_EMULATE_MALLOC + #include + + void* malloc(size_t size) { + return gfxAlloc(size); + } + void free(void *ptr) { + gfxFree(ptr); + } +#endif -- cgit v1.2.3