mbed os with nrf51 internal bandgap enabled to read battery level

Dependents:   BLE_file_test BLE_Blink ExternalEncoder

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /* mbed Microcontroller Library
elessair 0:f269e3021894 2 * Copyright (c) 2006-2016 ARM Limited
elessair 0:f269e3021894 3 *
elessair 0:f269e3021894 4 * Licensed under the Apache License, Version 2.0 (the "License");
elessair 0:f269e3021894 5 * you may not use this file except in compliance with the License.
elessair 0:f269e3021894 6 * You may obtain a copy of the License at
elessair 0:f269e3021894 7 *
elessair 0:f269e3021894 8 * http://www.apache.org/licenses/LICENSE-2.0
elessair 0:f269e3021894 9 *
elessair 0:f269e3021894 10 * Unless required by applicable law or agreed to in writing, software
elessair 0:f269e3021894 11 * distributed under the License is distributed on an "AS IS" BASIS,
elessair 0:f269e3021894 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
elessair 0:f269e3021894 13 * See the License for the specific language governing permissions and
elessair 0:f269e3021894 14 * limitations under the License.
elessair 0:f269e3021894 15 */
elessair 0:f269e3021894 16
elessair 0:f269e3021894 17 #include "platform/mbed_mem_trace.h"
elessair 0:f269e3021894 18 #include "platform/mbed_stats.h"
elessair 0:f269e3021894 19 #include "platform/toolchain.h"
elessair 0:f269e3021894 20 #include "platform/SingletonPtr.h"
elessair 0:f269e3021894 21 #include "platform/PlatformMutex.h"
elessair 0:f269e3021894 22 #include <stddef.h>
elessair 0:f269e3021894 23 #include <stdio.h>
elessair 0:f269e3021894 24 #include <string.h>
elessair 0:f269e3021894 25 #include <stdlib.h>
elessair 0:f269e3021894 26
elessair 0:f269e3021894 27 /* There are two memory tracers in mbed OS:
elessair 0:f269e3021894 28
elessair 0:f269e3021894 29 - the first can be used to detect the maximum heap usage at runtime. It is
elessair 0:f269e3021894 30 activated by defining the MBED_HEAP_STATS_ENABLED macro.
elessair 0:f269e3021894 31 - the second can be used to trace each memory call by automatically invoking
elessair 0:f269e3021894 32 a callback on each memory operation (see hal/api/mbed_mem_trace.h). It is
elessair 0:f269e3021894 33 activated by defining the MBED_MEM_TRACING_ENABLED macro.
elessair 0:f269e3021894 34
elessair 0:f269e3021894 35 Both tracers can be activated and deactivated in any combination. If both tracers
elessair 0:f269e3021894 36 are active, the second one (MBED_MEM_TRACING_ENABLED) will trace the first one's
elessair 0:f269e3021894 37 (MBED_HEAP_STATS_ENABLED) memory calls.*/
elessair 0:f269e3021894 38
elessair 0:f269e3021894 39 /******************************************************************************/
elessair 0:f269e3021894 40 /* Implementation of the runtime max heap usage checker */
elessair 0:f269e3021894 41 /******************************************************************************/
elessair 0:f269e3021894 42
elessair 0:f269e3021894 43 /* Size must be a multiple of 8 to keep alignment */
elessair 0:f269e3021894 44 typedef struct {
elessair 0:f269e3021894 45 uint32_t size;
elessair 0:f269e3021894 46 uint32_t pad;
elessair 0:f269e3021894 47 } alloc_info_t;
elessair 0:f269e3021894 48
elessair 0:f269e3021894 49 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 50 static SingletonPtr<PlatformMutex> mem_trace_mutex;
elessair 0:f269e3021894 51 #endif
elessair 0:f269e3021894 52 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 53 static SingletonPtr<PlatformMutex> malloc_stats_mutex;
elessair 0:f269e3021894 54 static mbed_stats_heap_t heap_stats = {0, 0, 0, 0, 0};
elessair 0:f269e3021894 55 #endif
elessair 0:f269e3021894 56
elessair 0:f269e3021894 57 void mbed_stats_heap_get(mbed_stats_heap_t *stats)
elessair 0:f269e3021894 58 {
elessair 0:f269e3021894 59 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 60 malloc_stats_mutex->lock();
elessair 0:f269e3021894 61 memcpy(stats, &heap_stats, sizeof(mbed_stats_heap_t));
elessair 0:f269e3021894 62 malloc_stats_mutex->unlock();
elessair 0:f269e3021894 63 #else
elessair 0:f269e3021894 64 memset(stats, 0, sizeof(mbed_stats_heap_t));
elessair 0:f269e3021894 65 #endif
elessair 0:f269e3021894 66 }
elessair 0:f269e3021894 67
elessair 0:f269e3021894 68 /******************************************************************************/
elessair 0:f269e3021894 69 /* GCC memory allocation wrappers */
elessair 0:f269e3021894 70 /******************************************************************************/
elessair 0:f269e3021894 71
elessair 0:f269e3021894 72 #if defined(TOOLCHAIN_GCC)
elessair 0:f269e3021894 73
elessair 0:f269e3021894 74 #ifdef FEATURE_UVISOR
elessair 0:f269e3021894 75 #include "uvisor-lib/uvisor-lib.h"
elessair 0:f269e3021894 76 #endif/* FEATURE_UVISOR */
elessair 0:f269e3021894 77
elessair 0:f269e3021894 78 extern "C" {
elessair 0:f269e3021894 79 void * __real__malloc_r(struct _reent * r, size_t size);
elessair 0:f269e3021894 80 void * __real__realloc_r(struct _reent * r, void * ptr, size_t size);
elessair 0:f269e3021894 81 void __real__free_r(struct _reent * r, void * ptr);
elessair 0:f269e3021894 82 void* __real__calloc_r(struct _reent * r, size_t nmemb, size_t size);
elessair 0:f269e3021894 83 }
elessair 0:f269e3021894 84
elessair 0:f269e3021894 85 // TODO: memory tracing doesn't work with uVisor enabled.
elessair 0:f269e3021894 86 #if !defined(FEATURE_UVISOR)
elessair 0:f269e3021894 87
elessair 0:f269e3021894 88 extern "C" void * __wrap__malloc_r(struct _reent * r, size_t size) {
elessair 0:f269e3021894 89 void *ptr = NULL;
elessair 0:f269e3021894 90 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 91 malloc_stats_mutex->lock();
elessair 0:f269e3021894 92 alloc_info_t *alloc_info = (alloc_info_t*)__real__malloc_r(r, size + sizeof(alloc_info_t));
elessair 0:f269e3021894 93 if (alloc_info != NULL) {
elessair 0:f269e3021894 94 alloc_info->size = size;
elessair 0:f269e3021894 95 ptr = (void*)(alloc_info + 1);
elessair 0:f269e3021894 96 heap_stats.current_size += size;
elessair 0:f269e3021894 97 heap_stats.total_size += size;
elessair 0:f269e3021894 98 heap_stats.alloc_cnt += 1;
elessair 0:f269e3021894 99 if (heap_stats.current_size > heap_stats.max_size) {
elessair 0:f269e3021894 100 heap_stats.max_size = heap_stats.current_size;
elessair 0:f269e3021894 101 }
elessair 0:f269e3021894 102 } else {
elessair 0:f269e3021894 103 heap_stats.alloc_fail_cnt += 1;
elessair 0:f269e3021894 104 }
elessair 0:f269e3021894 105 malloc_stats_mutex->unlock();
elessair 0:f269e3021894 106 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 107 ptr = __real__malloc_r(r, size);
elessair 0:f269e3021894 108 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 109 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 110 mem_trace_mutex->lock();
elessair 0:f269e3021894 111 mbed_mem_trace_malloc(ptr, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 112 mem_trace_mutex->unlock();
elessair 0:f269e3021894 113 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 114 return ptr;
elessair 0:f269e3021894 115 }
elessair 0:f269e3021894 116
elessair 0:f269e3021894 117 extern "C" void * __wrap__realloc_r(struct _reent * r, void * ptr, size_t size) {
elessair 0:f269e3021894 118 void *new_ptr = NULL;
elessair 0:f269e3021894 119 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 120 // Implement realloc_r with malloc and free.
elessair 0:f269e3021894 121 // The function realloc_r can't be used here directly since
elessair 0:f269e3021894 122 // it can call into __wrap__malloc_r (returns ptr + 4) or
elessair 0:f269e3021894 123 // resize memory directly (returns ptr + 0).
elessair 0:f269e3021894 124
elessair 0:f269e3021894 125 // Note - no lock needed since malloc and free are thread safe
elessair 0:f269e3021894 126
elessair 0:f269e3021894 127 // Get old size
elessair 0:f269e3021894 128 uint32_t old_size = 0;
elessair 0:f269e3021894 129 if (ptr != NULL) {
elessair 0:f269e3021894 130 alloc_info_t *alloc_info = ((alloc_info_t*)ptr) - 1;
elessair 0:f269e3021894 131 old_size = alloc_info->size;
elessair 0:f269e3021894 132 }
elessair 0:f269e3021894 133
elessair 0:f269e3021894 134 // Allocate space
elessair 0:f269e3021894 135 if (size != 0) {
elessair 0:f269e3021894 136 new_ptr = malloc(size);
elessair 0:f269e3021894 137 }
elessair 0:f269e3021894 138
elessair 0:f269e3021894 139 // If the new buffer has been allocated copy the data to it
elessair 0:f269e3021894 140 // and free the old buffer
elessair 0:f269e3021894 141 if (new_ptr != NULL) {
elessair 0:f269e3021894 142 uint32_t copy_size = (old_size < size) ? old_size : size;
elessair 0:f269e3021894 143 memcpy(new_ptr, (void*)ptr, copy_size);
elessair 0:f269e3021894 144 free(ptr);
elessair 0:f269e3021894 145 }
elessair 0:f269e3021894 146 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 147 new_ptr = __real__realloc_r(r, ptr, size);
elessair 0:f269e3021894 148 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 149 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 150 mem_trace_mutex->lock();
elessair 0:f269e3021894 151 mbed_mem_trace_realloc(new_ptr, ptr, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 152 mem_trace_mutex->unlock();
elessair 0:f269e3021894 153 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 154 return new_ptr;
elessair 0:f269e3021894 155 }
elessair 0:f269e3021894 156
elessair 0:f269e3021894 157 extern "C" void __wrap__free_r(struct _reent * r, void * ptr) {
elessair 0:f269e3021894 158 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 159 malloc_stats_mutex->lock();
elessair 0:f269e3021894 160 alloc_info_t *alloc_info = NULL;
elessair 0:f269e3021894 161 if (ptr != NULL) {
elessair 0:f269e3021894 162 alloc_info = ((alloc_info_t*)ptr) - 1;
elessair 0:f269e3021894 163 heap_stats.current_size -= alloc_info->size;
elessair 0:f269e3021894 164 heap_stats.alloc_cnt -= 1;
elessair 0:f269e3021894 165 }
elessair 0:f269e3021894 166 __real__free_r(r, (void*)alloc_info);
elessair 0:f269e3021894 167 malloc_stats_mutex->unlock();
elessair 0:f269e3021894 168 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 169 __real__free_r(r, ptr);
elessair 0:f269e3021894 170 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 171 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 172 mem_trace_mutex->lock();
elessair 0:f269e3021894 173 mbed_mem_trace_free(ptr, MBED_CALLER_ADDR());
elessair 0:f269e3021894 174 mem_trace_mutex->unlock();
elessair 0:f269e3021894 175 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 176 }
elessair 0:f269e3021894 177
elessair 0:f269e3021894 178 #endif // if !defined(FEATURE_UVISOR)
elessair 0:f269e3021894 179
elessair 0:f269e3021894 180 extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size) {
elessair 0:f269e3021894 181 void *ptr = NULL;
elessair 0:f269e3021894 182 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 183 // Note - no lock needed since malloc is thread safe
elessair 0:f269e3021894 184
elessair 0:f269e3021894 185 ptr = malloc(nmemb * size);
elessair 0:f269e3021894 186 if (ptr != NULL) {
elessair 0:f269e3021894 187 memset(ptr, 0, nmemb * size);
elessair 0:f269e3021894 188 }
elessair 0:f269e3021894 189 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 190 ptr = __real__calloc_r(r, nmemb, size);
elessair 0:f269e3021894 191 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 192 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 193 mem_trace_mutex->lock();
elessair 0:f269e3021894 194 mbed_mem_trace_calloc(ptr, nmemb, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 195 mem_trace_mutex->unlock();
elessair 0:f269e3021894 196 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 197 return ptr;
elessair 0:f269e3021894 198 }
elessair 0:f269e3021894 199
elessair 0:f269e3021894 200
elessair 0:f269e3021894 201 /******************************************************************************/
elessair 0:f269e3021894 202 /* ARMCC memory allocation wrappers */
elessair 0:f269e3021894 203 /******************************************************************************/
elessair 0:f269e3021894 204
elessair 0:f269e3021894 205 #elif defined(TOOLCHAIN_ARM) // #if defined(TOOLCHAIN_GCC)
elessair 0:f269e3021894 206
elessair 0:f269e3021894 207 /* Enable hooking of memory function only if tracing is also enabled */
elessair 0:f269e3021894 208 #if defined(MBED_MEM_TRACING_ENABLED) || defined(MBED_HEAP_STATS_ENABLED)
elessair 0:f269e3021894 209
elessair 0:f269e3021894 210 extern "C" {
elessair 0:f269e3021894 211 void *$Super$$malloc(size_t size);
elessair 0:f269e3021894 212 void *$Super$$realloc(void *ptr, size_t size);
elessair 0:f269e3021894 213 void *$Super$$calloc(size_t nmemb, size_t size);
elessair 0:f269e3021894 214 void $Super$$free(void *ptr);
elessair 0:f269e3021894 215 }
elessair 0:f269e3021894 216
elessair 0:f269e3021894 217 extern "C" void* $Sub$$malloc(size_t size) {
elessair 0:f269e3021894 218 void *ptr = NULL;
elessair 0:f269e3021894 219 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 220 malloc_stats_mutex->lock();
elessair 0:f269e3021894 221 alloc_info_t *alloc_info = (alloc_info_t*)$Super$$malloc(size + sizeof(alloc_info_t));
elessair 0:f269e3021894 222 if (alloc_info != NULL) {
elessair 0:f269e3021894 223 alloc_info->size = size;
elessair 0:f269e3021894 224 ptr = (void*)(alloc_info + 1);
elessair 0:f269e3021894 225 heap_stats.current_size += size;
elessair 0:f269e3021894 226 heap_stats.total_size += size;
elessair 0:f269e3021894 227 heap_stats.alloc_cnt += 1;
elessair 0:f269e3021894 228 if (heap_stats.current_size > heap_stats.max_size) {
elessair 0:f269e3021894 229 heap_stats.max_size = heap_stats.current_size;
elessair 0:f269e3021894 230 }
elessair 0:f269e3021894 231 } else {
elessair 0:f269e3021894 232 heap_stats.alloc_fail_cnt += 1;
elessair 0:f269e3021894 233 }
elessair 0:f269e3021894 234 malloc_stats_mutex->unlock();
elessair 0:f269e3021894 235 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 236 ptr = $Super$$malloc(size);
elessair 0:f269e3021894 237 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 238 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 239 mem_trace_mutex->lock();
elessair 0:f269e3021894 240 mbed_mem_trace_malloc(ptr, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 241 mem_trace_mutex->unlock();
elessair 0:f269e3021894 242 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 243 return ptr;
elessair 0:f269e3021894 244 }
elessair 0:f269e3021894 245
elessair 0:f269e3021894 246 extern "C" void* $Sub$$realloc(void *ptr, size_t size) {
elessair 0:f269e3021894 247 void *new_ptr = NULL;
elessair 0:f269e3021894 248 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 249 // Note - no lock needed since malloc and free are thread safe
elessair 0:f269e3021894 250
elessair 0:f269e3021894 251 // Get old size
elessair 0:f269e3021894 252 uint32_t old_size = 0;
elessair 0:f269e3021894 253 if (ptr != NULL) {
elessair 0:f269e3021894 254 alloc_info_t *alloc_info = ((alloc_info_t*)ptr) - 1;
elessair 0:f269e3021894 255 old_size = alloc_info->size;
elessair 0:f269e3021894 256 }
elessair 0:f269e3021894 257
elessair 0:f269e3021894 258 // Allocate space
elessair 0:f269e3021894 259 if (size != 0) {
elessair 0:f269e3021894 260 new_ptr = malloc(size);
elessair 0:f269e3021894 261 }
elessair 0:f269e3021894 262
elessair 0:f269e3021894 263 // If the new buffer has been allocated copy the data to it
elessair 0:f269e3021894 264 // and free the old buffer
elessair 0:f269e3021894 265 if (new_ptr != NULL) {
elessair 0:f269e3021894 266 uint32_t copy_size = (old_size < size) ? old_size : size;
elessair 0:f269e3021894 267 memcpy(new_ptr, (void*)ptr, copy_size);
elessair 0:f269e3021894 268 free(ptr);
elessair 0:f269e3021894 269 }
elessair 0:f269e3021894 270 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 271 new_ptr = $Super$$realloc(ptr, size);
elessair 0:f269e3021894 272 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 273 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 274 mem_trace_mutex->lock();
elessair 0:f269e3021894 275 mbed_mem_trace_realloc(new_ptr, ptr, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 276 mem_trace_mutex->unlock();
elessair 0:f269e3021894 277 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 278 return new_ptr;
elessair 0:f269e3021894 279 }
elessair 0:f269e3021894 280
elessair 0:f269e3021894 281 extern "C" void *$Sub$$calloc(size_t nmemb, size_t size) {
elessair 0:f269e3021894 282 void *ptr = NULL;
elessair 0:f269e3021894 283 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 284 // Note - no lock needed since malloc is thread safe
elessair 0:f269e3021894 285 ptr = malloc(nmemb * size);
elessair 0:f269e3021894 286 if (ptr != NULL) {
elessair 0:f269e3021894 287 memset(ptr, 0, nmemb * size);
elessair 0:f269e3021894 288 }
elessair 0:f269e3021894 289 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 290 ptr = $Super$$calloc(nmemb, size);
elessair 0:f269e3021894 291 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 292 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 293 mem_trace_mutex->lock();
elessair 0:f269e3021894 294 mbed_mem_trace_calloc(ptr, nmemb, size, MBED_CALLER_ADDR());
elessair 0:f269e3021894 295 mem_trace_mutex->unlock();
elessair 0:f269e3021894 296 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 297 return ptr;
elessair 0:f269e3021894 298 }
elessair 0:f269e3021894 299
elessair 0:f269e3021894 300 extern "C" void $Sub$$free(void *ptr) {
elessair 0:f269e3021894 301 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 302 malloc_stats_mutex->lock();
elessair 0:f269e3021894 303 alloc_info_t *alloc_info = NULL;
elessair 0:f269e3021894 304 if (ptr != NULL) {
elessair 0:f269e3021894 305 alloc_info = ((alloc_info_t*)ptr) - 1;
elessair 0:f269e3021894 306 heap_stats.current_size -= alloc_info->size;
elessair 0:f269e3021894 307 heap_stats.alloc_cnt -= 1;
elessair 0:f269e3021894 308 }
elessair 0:f269e3021894 309 $Super$$free((void*)alloc_info);
elessair 0:f269e3021894 310 malloc_stats_mutex->unlock();
elessair 0:f269e3021894 311 #else // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 312 $Super$$free(ptr);
elessair 0:f269e3021894 313 #endif // #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 314 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 315 mem_trace_mutex->lock();
elessair 0:f269e3021894 316 mbed_mem_trace_free(ptr, MBED_CALLER_ADDR());
elessair 0:f269e3021894 317 mem_trace_mutex->unlock();
elessair 0:f269e3021894 318 #endif // #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 319 }
elessair 0:f269e3021894 320
elessair 0:f269e3021894 321 #endif // #if defined(MBED_MEM_TRACING_ENABLED) || defined(MBED_HEAP_STATS_ENABLED)
elessair 0:f269e3021894 322
elessair 0:f269e3021894 323 /******************************************************************************/
elessair 0:f269e3021894 324 /* Allocation wrappers for other toolchains are not supported yet */
elessair 0:f269e3021894 325 /******************************************************************************/
elessair 0:f269e3021894 326
elessair 0:f269e3021894 327 #else // #if defined(TOOLCHAIN_GCC)
elessair 0:f269e3021894 328
elessair 0:f269e3021894 329 #ifdef MBED_MEM_TRACING_ENABLED
elessair 0:f269e3021894 330 #warning Memory tracing is not supported with the current toolchain.
elessair 0:f269e3021894 331 #endif
elessair 0:f269e3021894 332
elessair 0:f269e3021894 333 #ifdef MBED_HEAP_STATS_ENABLED
elessair 0:f269e3021894 334 #warning Heap statistics are not supported with the current toolchain.
elessair 0:f269e3021894 335 #endif
elessair 0:f269e3021894 336
elessair 0:f269e3021894 337 #endif // #if defined(TOOLCHAIN_GCC)
elessair 0:f269e3021894 338