Merge pull request #3686 from embhorn/zd11571

Fix Free/SafeRTOS with XMALLOC_USER
pull/3751/head
toddouska 2021-02-11 13:50:55 -08:00 committed by GitHub
commit 1283a4d9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 15 deletions

View File

@ -721,18 +721,20 @@ extern void uITRON4_free(void *p) ;
!defined(WOLFSSL_STATIC_MEMORY)
#define XMALLOC(s, h, type) pvPortMalloc((s))
#define XFREE(p, h, type) vPortFree((p))
#endif
/* FreeRTOS pvPortRealloc() implementation can be found here:
https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
#if !defined(USE_FAST_MATH) || defined(HAVE_ED25519) || defined(HAVE_ED448)
#if defined(WOLFSSL_ESPIDF)
/*In IDF, realloc(p, n) is equivalent to
heap_caps_realloc(p, s, MALLOC_CAP_8BIT) */
#define XREALLOC(p, n, h, t) realloc((p), (n))
#else
#define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
/* FreeRTOS pvPortRealloc() implementation can be found here:
https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
#if !defined(USE_FAST_MATH) || defined(HAVE_ED25519) || \
defined(HAVE_ED448)
#if defined(WOLFSSL_ESPIDF)
/*In IDF, realloc(p, n) is equivalent to
heap_caps_realloc(p, s, MALLOC_CAP_8BIT) */
#define XREALLOC(p, n, h, t) realloc((p), (n))
#else
#define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
#endif
#endif
#endif
#ifndef NO_WRITEV
#define NO_WRITEV
#endif
@ -910,11 +912,13 @@ extern void uITRON4_free(void *p) ;
!defined(WOLFSSL_STATIC_MEMORY)
#define XMALLOC(s, h, type) pvPortMalloc((s))
#define XFREE(p, h, type) vPortFree((p))
#endif
/* FreeRTOS pvPortRealloc() implementation can be found here:
https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
#if !defined(USE_FAST_MATH) || defined(HAVE_ED25519) || defined(HAVE_ED448)
#define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
/* FreeRTOS pvPortRealloc() implementation can be found here:
https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
#if !defined(USE_FAST_MATH) || defined(HAVE_ED25519) || \
defined(HAVE_ED448)
#define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
#endif
#endif
#endif