aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/gos_x_heap.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-11-27 10:15:46 +1000
committerinmarket <andrewh@inmarket.com.au>2015-11-27 10:15:46 +1000
commit0313756ea38d71cfce21a0a905f4fc43ac68d197 (patch)
tree035235b019041b5f75a64ab95a93ff8f7d027cb2 /src/gos/gos_x_heap.c
parent3681542e242bc6170b5c98aaa52a6df9ad21cae3 (diff)
downloaduGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.tar.gz
uGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.tar.bz2
uGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.zip
Add ability to emulate malloc() and free() to prevent nasty hard to find link errors from C library routines that need malloc
Diffstat (limited to 'src/gos/gos_x_heap.c')
-rw-r--r--src/gos/gos_x_heap.c11
1 files changed, 11 insertions, 0 deletions
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 <stdlib.h>
+
+ void* malloc(size_t size) {
+ return gfxAlloc(size);
+ }
+ void free(void *ptr) {
+ gfxFree(ptr);
+ }
+#endif