SafeRTOS memory macros

This commit is contained in:
toddouska 2012-08-20 16:38:43 -07:00
parent 690938ffd4
commit f1ed3cefc4
2 changed files with 6 additions and 1 deletions

View File

@ -170,6 +170,11 @@
#ifndef SINGLE_THREADED #ifndef SINGLE_THREADED
#include "SafeRTOS/semphr.h" #include "SafeRTOS/semphr.h"
#endif #endif
#include "SafeRTOS/heap.h"
#define XMALLOC(s, h, type) pvPortMalloc((s))
#define XFREE(p, h, type) vPortFree((p))
#define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
#endif #endif
#ifdef MICRIUM #ifdef MICRIUM

View File

@ -148,7 +148,7 @@ enum {
extern void *XMALLOC(size_t n, void* heap, int type); extern void *XMALLOC(size_t n, void* heap, int type);
extern void *XREALLOC(void *p, size_t n, void* heap, int type); extern void *XREALLOC(void *p, size_t n, void* heap, int type);
extern void XFREE(void *p, void* heap, int type); extern void XFREE(void *p, void* heap, int type);
#elif !defined(MICRIUM_MALLOC) && !defined(EBSNET) #elif !defined(MICRIUM_MALLOC) && !defined(EBSNET) && !defined(CYASSL_SAFERTOS)
/* default C runtime, can install different routines at runtime */ /* default C runtime, can install different routines at runtime */
#include <cyassl/ctaocrypt/memory.h> #include <cyassl/ctaocrypt/memory.h>
#define XMALLOC(s, h, t) CyaSSL_Malloc((s)) #define XMALLOC(s, h, t) CyaSSL_Malloc((s))