1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

OOM debug option: simplify its management and make it compatible with arduino-1.9beta (#4357)

This commit is contained in:
david gauchard
2018-03-16 19:56:32 +01:00
committed by GitHub
parent edd2754e2f
commit 732e22ec37
3 changed files with 75 additions and 86 deletions

View File

@ -2,13 +2,6 @@
* Configuration for umm_malloc
*/
// with DEBUG_ESP_OOM debug option activated,
// implying gcc option '-include this-file'
// this file is included in *every* source file
// *before* any other include file
#ifndef __ASSEMBLER__
#ifndef _UMM_MALLOC_CFG_H
#define _UMM_MALLOC_CFG_H
@ -184,11 +177,8 @@ extern char _heap_start;
#ifdef DEBUG_ESP_OOM
// this must be outside from "#ifndef _UMM_MALLOC_CFG_H"
// because Arduino.h's <cstdlib> does #undef *alloc
// so Arduino.h recall us to redefine them
// Arduino.h recall us to redefine them
#define malloc(s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; malloc_loc(s, mem_debug_file, __LINE__); })
#define calloc(n,s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; calloc_loc(n, s, mem_debug_file, __LINE__); })
#define realloc(p,s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; realloc_loc(p, s, mem_debug_file, __LINE__); })
#endif
#endif /* !__ASSEMBLER__ */
#endif /* DEBUG_ESP_OOM */