Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-os-example-mbed5-blinky by
heap_monitor.h
00001 #ifndef _HEAP_MONITOR_H_ 00002 #define _HEAP_MONITOR_H_ 00003 00004 #ifdef HEAP_MONITOR 00005 #define MALLOC(size, module) malloc_t(size, module) 00006 #define REALLOC(ptr, size, module) realloc_t(ptr, size, module) 00007 #define CALLOC(nmemb, size, module) calloc_t(nmemb, size, module) 00008 #define FREE(ptr) free_t(ptr) 00009 #define NEW(module) new (module) 00010 00011 #ifdef __cplusplus 00012 extern "C" { 00013 #endif 00014 00015 enum module { 00016 OS = 0, 00017 APP = 1, 00018 OTA = 2, 00019 CA = 3, 00020 HTTP = 4, 00021 MEDIA = 5, 00022 RECORDER = 6, 00023 SPEEX_LIB = 7, 00024 MAX_MODULE = 8, 00025 }; 00026 00027 extern void init_heap_info(void); 00028 extern void show_heap_info(void); 00029 extern void *malloc_t(size_t size, enum module module); 00030 extern void *calloc_t(size_t nmemb, size_t size, enum module module); 00031 extern void *realloc_t(void *ptr, size_t size, enum module module); 00032 extern void free_t(void *ptr); 00033 00034 #ifdef __cplusplus 00035 } 00036 00037 void * operator new(std::size_t size, int module); 00038 void * operator new[](std::size_t size, int module); 00039 00040 #endif 00041 00042 #else 00043 #define MALLOC(size, module) malloc(size) 00044 #define REALLOC(ptr, size, module) realloc(ptr, size) 00045 #define CALLOC(nmemb, size, module) calloc(nmemb, size) 00046 #define FREE(ptr) free(ptr) 00047 #define NEW(module) new 00048 #endif // HEAP_MONITOR 00049 00050 #endif
Generated on Tue Jul 12 2022 16:28:53 by
1.7.2
