forked from wolfSSL/wolfssl
Merge pull request #7274 from SKlimaRA/SKlimaRA/fix-embos-heap-allocation-macros
fixed XMALLOC, XFREE and XREALLOC definitions for embOS
This commit is contained in:
@@ -2123,9 +2123,17 @@ extern void uITRON4_free(void *p) ;
|
|||||||
#include "RTOS.h"
|
#include "RTOS.h"
|
||||||
#if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
|
#if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
|
||||||
!defined(WOLFSSL_STATIC_MEMORY)
|
!defined(WOLFSSL_STATIC_MEMORY)
|
||||||
#define XMALLOC(s, h, type) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
|
/* Per the user manual of embOS https://www.segger.com/downloads/embos/UM01001
|
||||||
#define XFREE(p, h, type) ((void)(h), (void)(type), OS_HEAP_free((p)))
|
* this API has changed with V5. */
|
||||||
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), OS_HEAP_realloc(((p), (n)))
|
#if (OS_VERSION >= 50000U)
|
||||||
|
#define XMALLOC(s, h, type) ((void)(h), (void)(type), OS_HEAP_malloc((s)))
|
||||||
|
#define XFREE(p, h, type) ((void)(h), (void)(type), OS_HEAP_free((p)))
|
||||||
|
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), OS_HEAP_realloc((p), (n)))
|
||||||
|
#else
|
||||||
|
#define XMALLOC(s, h, type) ((void)(h), (void)(type), OS_malloc((s)))
|
||||||
|
#define XFREE(p, h, type) ((void)(h), (void)(type), OS_free((p)))
|
||||||
|
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), OS_realloc((p), (n)))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -558,6 +558,10 @@ typedef struct w64wrapper {
|
|||||||
#endif
|
#endif
|
||||||
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), (h), (t))
|
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), (h), (t))
|
||||||
#endif /* WOLFSSL_DEBUG_MEMORY */
|
#endif /* WOLFSSL_DEBUG_MEMORY */
|
||||||
|
#elif defined(WOLFSSL_EMBOS) && !defined(XMALLOC_USER) \
|
||||||
|
&& !defined(NO_WOLFSSL_MEMORY) \
|
||||||
|
&& !defined(WOLFSSL_STATIC_MEMORY)
|
||||||
|
/* settings.h solve this case already. Avoid redefinition. */
|
||||||
#elif (!defined(FREERTOS) && !defined(FREERTOS_TCP)) || defined(WOLFSSL_TRACK_MEMORY)
|
#elif (!defined(FREERTOS) && !defined(FREERTOS_TCP)) || defined(WOLFSSL_TRACK_MEMORY)
|
||||||
#ifdef WOLFSSL_DEBUG_MEMORY
|
#ifdef WOLFSSL_DEBUG_MEMORY
|
||||||
#define XMALLOC(s, h, t) ((void)(h), (void)(t), wolfSSL_Malloc((s), __func__, __LINE__))
|
#define XMALLOC(s, h, t) ((void)(h), (void)(t), wolfSSL_Malloc((s), __func__, __LINE__))
|
||||||
|
Reference in New Issue
Block a user