diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-11-27 10:15:46 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-11-27 10:15:46 +1000 |
commit | 0313756ea38d71cfce21a0a905f4fc43ac68d197 (patch) | |
tree | 035235b019041b5f75a64ab95a93ff8f7d027cb2 /src/gos/gos_x_heap.c | |
parent | 3681542e242bc6170b5c98aaa52a6df9ad21cae3 (diff) | |
download | uGFX-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.c | 11 |
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 |