mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #2607 from 0xc0170/fix_uvisor_memory_tracing
Fix uvisor memory tracingpull/2617/head
commit
fbf535be59
|
@ -67,9 +67,6 @@ void mbed_stats_heap_get(mbed_stats_heap_t *stats)
|
||||||
#include "uvisor-lib/uvisor-lib.h"
|
#include "uvisor-lib/uvisor-lib.h"
|
||||||
#endif/* FEATURE_UVISOR */
|
#endif/* FEATURE_UVISOR */
|
||||||
|
|
||||||
// TODO: memory tracing doesn't work with uVisor enabled.
|
|
||||||
#if !defined(FEATURE_UVISOR)
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void * __real__malloc_r(struct _reent * r, size_t size);
|
void * __real__malloc_r(struct _reent * r, size_t size);
|
||||||
void * __real__realloc_r(struct _reent * r, void * ptr, size_t size);
|
void * __real__realloc_r(struct _reent * r, void * ptr, size_t size);
|
||||||
|
@ -77,6 +74,9 @@ extern "C" {
|
||||||
void* __real__calloc_r(struct _reent * r, size_t nmemb, size_t size);
|
void* __real__calloc_r(struct _reent * r, size_t nmemb, size_t size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: memory tracing doesn't work with uVisor enabled.
|
||||||
|
#if !defined(FEATURE_UVISOR)
|
||||||
|
|
||||||
extern "C" void * __wrap__malloc_r(struct _reent * r, size_t size) {
|
extern "C" void * __wrap__malloc_r(struct _reent * r, size_t size) {
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
#ifdef MBED_HEAP_STATS_ENABLED
|
#ifdef MBED_HEAP_STATS_ENABLED
|
||||||
|
@ -167,6 +167,8 @@ extern "C" void __wrap__free_r(struct _reent * r, void * ptr) {
|
||||||
#endif // #ifdef MBED_MEM_TRACING_ENABLED
|
#endif // #ifdef MBED_MEM_TRACING_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // if !defined(FEATURE_UVISOR)
|
||||||
|
|
||||||
extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size) {
|
extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size) {
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
#ifdef MBED_HEAP_STATS_ENABLED
|
#ifdef MBED_HEAP_STATS_ENABLED
|
||||||
|
@ -187,7 +189,6 @@ extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // if !defined(FEATURE_UVISOR)
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* ARMCC memory allocation wrappers */
|
/* ARMCC memory allocation wrappers */
|
||||||
|
|
|
@ -480,10 +480,9 @@ extern "C" WEAK void __cxa_pure_virtual(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TOOLCHAIN_GCC)
|
#if defined(TOOLCHAIN_GCC)
|
||||||
/* uVisor wraps malloc_r, realloc_r and free_r, but not calloc_r! */
|
|
||||||
#ifndef FEATURE_UVISOR
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef FEATURE_UVISOR
|
||||||
|
#include "uvisor-lib/uvisor-lib.h"
|
||||||
#endif/* FEATURE_UVISOR */
|
#endif/* FEATURE_UVISOR */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue