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.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gos/gos.h') diff --git a/src/gos/gos.h b/src/gos/gos.h index 445e4b3a..172a813e 100644 --- a/src/gos/gos.h +++ b/src/gos/gos.h @@ -175,6 +175,23 @@ */ void gfxFree(void *ptr); + /** + * @brief Use gfxAlloc and gfxFree to implement malloc() and free() + * + * @notes Sometimes your application will include functions that + * want to internally use malloc() and free(). As the default + * implementations of these in your C library are almost + * invariably incorrect for an embedded platform, this option + * allows you to emulate those calls with gfxAlloc() and gfxFree(). + * An example is the C library routine rand() which on many + * implementations internally uses malloc(). + * + * @api + */ + #ifndef GFX_EMULATE_MALLOC + #define GFX_EMULATE_MALLOC FALSE + #endif + /** * @brief Yield the current thread * @details Give up the rest of the current time slice for this thread in order to give other threads -- cgit v1.2.3