@@ -67,16 +67,16 @@ void mbed_stats_heap_get(mbed_stats_heap_t *stats)
6767#include " uvisor-lib/uvisor-lib.h"
6868#endif /* FEATURE_UVISOR */
6969
70- // TODO: memory tracing doesn't work with uVisor enabled.
71- #if !defined(FEATURE_UVISOR)
72-
7370extern " C" {
7471 void * __real__malloc_r (struct _reent * r, size_t size);
7572 void * __real__realloc_r (struct _reent * r, void * ptr, size_t size);
7673 void __real__free_r (struct _reent * r, void * ptr);
7774 void * __real__calloc_r (struct _reent * r, size_t nmemb, size_t size);
7875}
7976
77+ // TODO: memory tracing doesn't work with uVisor enabled.
78+ #if !defined(FEATURE_UVISOR)
79+
8080extern " C" void * __wrap__malloc_r (struct _reent * r, size_t size) {
8181 void *ptr = NULL ;
8282#ifdef MBED_HEAP_STATS_ENABLED
@@ -167,6 +167,8 @@ extern "C" void __wrap__free_r(struct _reent * r, void * ptr) {
167167#endif // #ifdef MBED_MEM_TRACING_ENABLED
168168}
169169
170+ #endif // if !defined(FEATURE_UVISOR)
171+
170172extern " C" void * __wrap__calloc_r (struct _reent * r, size_t nmemb, size_t size) {
171173 void *ptr = NULL ;
172174#ifdef MBED_HEAP_STATS_ENABLED
@@ -187,7 +189,6 @@ extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size)
187189 return ptr;
188190}
189191
190- #endif // if !defined(FEATURE_UVISOR)
191192
192193/* *****************************************************************************/
193194/* ARMCC memory allocation wrappers */
0 commit comments