feat(heap): Remove macro "MEMLEAK_DEBUG"

This commit is contained in:
Dong Heng
2018-09-10 15:11:44 +08:00
parent a4369522b9
commit e40b6d645a
6 changed files with 4 additions and 14 deletions

View File

@ -54,4 +54,4 @@ target_compile_options(${COMPONENT_NAME} PUBLIC -Wno-error=char-subscripts -Wno-
-Wno-error=unused-value -Wno-error=address -Wno-error=return-type -Wno-error=format-extra-args -Wno-error=unused-value -Wno-error=address -Wno-error=return-type -Wno-error=format-extra-args
-Wno-error=format-zero-length -Wno-error=unused-label -Wno-error=sizeof-pointer-memaccess) -Wno-error=format-zero-length -Wno-error=unused-label -Wno-error=sizeof-pointer-memaccess)
target_compile_options(${COMPONENT_NAME} PUBLIC -DMEMLEAK_DEBUG -DICACHE_FLASH) target_compile_options(${COMPONENT_NAME} PUBLIC -DICACHE_FLASH)

View File

@ -65,4 +65,4 @@ endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION
endif endif
# global CFLAGS for ESP8266 # global CFLAGS for ESP8266
CFLAGS += -DMEMLEAK_DEBUG -DICACHE_FLASH CFLAGS += -DICACHE_FLASH

View File

@ -238,7 +238,7 @@ void _heap_caps_free(void *ptr, const char *file, size_t line)
} }
mem_blk = ptr2blk(ptr, ptr_is_traced(ptr)); mem_blk = ptr2blk(ptr, ptr_is_traced(ptr));
#ifndef MEMLEAK_DEBUG #ifdef CONFIG_ESP_HEAP_CHECK_FREED
if (mem_blk->prev) { if (mem_blk->prev) {
ESP_EARLY_LOGE("%p already freed\n", ptr); ESP_EARLY_LOGE("%p already freed\n", ptr);
return; return;

View File

@ -98,19 +98,11 @@ static __inline__ uint64_t be64toh(uint64_t __x) {return (((uint64_t)be32toh(__x
#define htobe64(x) be64toh(x) #define htobe64(x) be64toh(x)
#endif #endif
#ifdef MEMLEAK_DEBUG
#define SSL_MALLOC(size) os_malloc(size) #define SSL_MALLOC(size) os_malloc(size)
#define SSL_REALLOC(mem_ref,size) os_realloc(mem_ref, size) #define SSL_REALLOC(mem_ref,size) os_realloc(mem_ref, size)
#define SSL_CALLOC(element, size) os_calloc(element, size) #define SSL_CALLOC(element, size) os_calloc(element, size)
#define SSL_ZALLOC(size) os_zalloc(size) #define SSL_ZALLOC(size) os_zalloc(size)
#define SSL_FREE(mem_ref) os_free(mem_ref) #define SSL_FREE(mem_ref) os_free(mem_ref)
#else
#define SSL_MALLOC(size) malloc(size)
#define SSL_REALLOC(mem_ref,size) realloc(mem_ref, size)
#define SSL_CALLOC(element, size) calloc(element, size)
#define SSL_ZALLOC(size) zalloc(size)
#define SSL_FREE(mem_ref) free(mem_ref)
#endif
#if 0 #if 0
#define FILE_NAME_LENGTH 25 #define FILE_NAME_LENGTH 25

View File

@ -5,4 +5,4 @@ set(COMPONENT_PRIV_REQUIRES lwip)
register_component() register_component()
component_compile_options(-DLWIP_OPEN_SRC -DMEMLEAK_DEBUG) component_compile_options(-DLWIP_OPEN_SRC)

View File

@ -4,5 +4,3 @@
COMPONENT_ADD_INCLUDEDIRS += include COMPONENT_ADD_INCLUDEDIRS += include
COMPONENT_SRCDIRS := ./ COMPONENT_SRCDIRS := ./
CFLAGS += -DMEMLEAK_DEBUG