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.h | |
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.h')
-rw-r--r-- | src/gos/gos.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ -176,6 +176,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 * a chance to run. |