From e40b6d645a3ad2a365b1a59b34cc29fc363f6d0b Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Mon, 10 Sep 2018 15:11:44 +0800 Subject: [PATCH] feat(heap): Remove macro "MEMLEAK_DEBUG" --- components/esp8266/CMakeLists.txt | 2 +- components/esp8266/Makefile.projbuild | 2 +- components/heap/src/esp_heap_caps.c | 2 +- components/ssl/axtls/include/ssl/ssl_os_port.h | 8 -------- components/tcpip_adapter/CMakeLists.txt | 2 +- components/tcpip_adapter/component.mk | 2 -- 6 files changed, 4 insertions(+), 14 deletions(-) diff --git a/components/esp8266/CMakeLists.txt b/components/esp8266/CMakeLists.txt index e04564bb..4ac9a8b4 100644 --- a/components/esp8266/CMakeLists.txt +++ b/components/esp8266/CMakeLists.txt @@ -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=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) diff --git a/components/esp8266/Makefile.projbuild b/components/esp8266/Makefile.projbuild index cdc8067e..3bccee87 100644 --- a/components/esp8266/Makefile.projbuild +++ b/components/esp8266/Makefile.projbuild @@ -65,4 +65,4 @@ endif # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION endif # global CFLAGS for ESP8266 -CFLAGS += -DMEMLEAK_DEBUG -DICACHE_FLASH +CFLAGS += -DICACHE_FLASH diff --git a/components/heap/src/esp_heap_caps.c b/components/heap/src/esp_heap_caps.c index 606365c6..db257d28 100644 --- a/components/heap/src/esp_heap_caps.c +++ b/components/heap/src/esp_heap_caps.c @@ -238,7 +238,7 @@ void _heap_caps_free(void *ptr, const char *file, size_t line) } mem_blk = ptr2blk(ptr, ptr_is_traced(ptr)); -#ifndef MEMLEAK_DEBUG +#ifdef CONFIG_ESP_HEAP_CHECK_FREED if (mem_blk->prev) { ESP_EARLY_LOGE("%p already freed\n", ptr); return; diff --git a/components/ssl/axtls/include/ssl/ssl_os_port.h b/components/ssl/axtls/include/ssl/ssl_os_port.h index 2626b8c5..0941cca6 100644 --- a/components/ssl/axtls/include/ssl/ssl_os_port.h +++ b/components/ssl/axtls/include/ssl/ssl_os_port.h @@ -98,19 +98,11 @@ static __inline__ uint64_t be64toh(uint64_t __x) {return (((uint64_t)be32toh(__x #define htobe64(x) be64toh(x) #endif -#ifdef MEMLEAK_DEBUG #define SSL_MALLOC(size) os_malloc(size) #define SSL_REALLOC(mem_ref,size) os_realloc(mem_ref, size) #define SSL_CALLOC(element, size) os_calloc(element, size) #define SSL_ZALLOC(size) os_zalloc(size) #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 #define FILE_NAME_LENGTH 25 diff --git a/components/tcpip_adapter/CMakeLists.txt b/components/tcpip_adapter/CMakeLists.txt index b0e6a88b..57be3cd0 100644 --- a/components/tcpip_adapter/CMakeLists.txt +++ b/components/tcpip_adapter/CMakeLists.txt @@ -5,4 +5,4 @@ set(COMPONENT_PRIV_REQUIRES lwip) register_component() -component_compile_options(-DLWIP_OPEN_SRC -DMEMLEAK_DEBUG) +component_compile_options(-DLWIP_OPEN_SRC) diff --git a/components/tcpip_adapter/component.mk b/components/tcpip_adapter/component.mk index 02c87887..75c898db 100644 --- a/components/tcpip_adapter/component.mk +++ b/components/tcpip_adapter/component.mk @@ -4,5 +4,3 @@ COMPONENT_ADD_INCLUDEDIRS += include COMPONENT_SRCDIRS := ./ - -CFLAGS += -DMEMLEAK_DEBUG