diff --git a/components/esp8266/include/esp_libc.h b/components/esp8266/include/esp_libc.h index 123bff35..4d9da371 100644 --- a/components/esp8266/include/esp_libc.h +++ b/components/esp8266/include/esp_libc.h @@ -113,48 +113,42 @@ bool ICACHE_FLASH_ATTR check_memleak_debug_enable(void) #ifndef os_free #define os_free(s) \ do{\ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - vPortFree_trace(s, mem_debug_file, __LINE__);\ + vPortFree_trace(s, __FILE__, __LINE__);\ }while(0) #endif #ifndef os_malloc #define os_malloc(s) \ ({ \ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - pvPortMalloc_trace(s, mem_debug_file, __LINE__, false); \ + pvPortMalloc_trace(s, __FILE__, __LINE__, false); \ }) #endif #ifndef os_malloc_iram #define os_malloc_iram(s) \ ({ \ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - pvPortMalloc_trace(s, mem_debug_file, __LINE__, true); \ + pvPortMalloc_trace(s, __FILE__, __LINE__, true); \ }) #endif #ifndef os_calloc #define os_calloc(p, s) \ ({ \ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - pvPortCalloc_trace(p, s, mem_debug_file, __LINE__); \ + pvPortCalloc_trace(p, s, __FILE__, __LINE__); \ }) #endif #ifndef os_realloc #define os_realloc(p, s) \ ({ \ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - pvPortRealloc_trace(p, s, mem_debug_file, __LINE__); \ + pvPortRealloc_trace(p, s, __FILE__, __LINE__); \ }) #endif #ifndef os_zalloc #define os_zalloc(s) \ ({ \ - static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \ - pvPortZalloc_trace(s, mem_debug_file, __LINE__); \ + pvPortZalloc_trace(s, __FILE__, __LINE__); \ }) #endif diff --git a/components/freertos/port/esp8266/heap_5.c b/components/freertos/port/esp8266/heap_5.c index 39c5de4c..c6c70d85 100644 --- a/components/freertos/port/esp8266/heap_5.c +++ b/components/freertos/port/esp8266/heap_5.c @@ -204,11 +204,6 @@ static HeapRegion_t xHeapRegions[] = #define vPortFree_t(pv) vPortFree(pv) #define pvPortCalloc_t(count, size) pvPortCalloc(count, size) #endif -/*-----------------------------------------------------------*/ - -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = "user_app"; -#endif /*-----------------------------------------------------------*/ bool ICACHE_FLASH_ATTR __attribute__((weak)) diff --git a/components/lwip/apps/dhcpserver/dhcpserver.c b/components/lwip/apps/dhcpserver/dhcpserver.c index 5f410718..dfc56dcd 100644 --- a/components/lwip/apps/dhcpserver/dhcpserver.c +++ b/components/lwip/apps/dhcpserver/dhcpserver.c @@ -21,17 +21,12 @@ #include "lwip/mem.h" #include "dhcpserver/dhcpserver.h" - -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - extern struct netif *esp_netif[2]; //////////////////////////////////////////////////////////////////////////////////// //static const uint8_t xid[4] = {0xad, 0xde, 0x12, 0x23}; //static u8_t old_xid[4] = {0}; -static const u32_t magic_cookie ICACHE_RODATA_ATTR STORE_ATTR = 0x63538263; +static const u32_t magic_cookie = 0x63538263; static struct udp_pcb* pcb_dhcps = NULL; static struct ip4_addr server_address; static struct ip4_addr client_address;//added diff --git a/components/lwip/apps/multi-threads/sockets_mt.c b/components/lwip/apps/multi-threads/sockets_mt.c index 7ab3cf8c..a00b3feb 100644 --- a/components/lwip/apps/multi-threads/sockets_mt.c +++ b/components/lwip/apps/multi-threads/sockets_mt.c @@ -442,7 +442,7 @@ LOCAL int lwip_exit_mt_ioctrl(int s, int arg) return 0; } -LOCAL const ICACHE_RODATA_ATTR STORE_ATTR lwip_io_mt_fn lwip_enter_mt_table[] = { +LOCAL const lwip_io_mt_fn lwip_enter_mt_table[] = { lwip_enter_mt_state, lwip_enter_mt_recv, lwip_enter_mt_ioctrl, @@ -451,7 +451,7 @@ LOCAL const ICACHE_RODATA_ATTR STORE_ATTR lwip_io_mt_fn lwip_enter_mt_table[] = lwip_enter_mt_close }; -LOCAL const ICACHE_RODATA_ATTR STORE_ATTR lwip_io_mt_fn lwip_exit_mt_table[] = { +LOCAL const lwip_io_mt_fn lwip_exit_mt_table[] = { lwip_exit_mt_state, lwip_exit_mt_recv, lwip_exit_mt_ioctrl, diff --git a/components/ssl/axtls/include/ssl/ssl_os_port.h b/components/ssl/axtls/include/ssl/ssl_os_port.h index 5af79a8d..8aa45eae 100644 --- a/components/ssl/axtls/include/ssl/ssl_os_port.h +++ b/components/ssl/axtls/include/ssl/ssl_os_port.h @@ -89,11 +89,11 @@ static __inline__ uint64 be64toh(uint64 __x) {return (((uint64)be32toh(__x & (ui #endif #ifdef MEMLEAK_DEBUG -#define SSL_MALLOC(size) ax_malloc(size, mem_debug_file, __LINE__) -#define SSL_REALLOC(mem_ref,size) ax_realloc(mem_ref, size, mem_debug_file, __LINE__) -#define SSL_CALLOC(element, size) ax_calloc(element, size, mem_debug_file, __LINE__) -#define SSL_ZALLOC(size) ax_zalloc(size, mem_debug_file, __LINE__) -#define SSL_FREE(mem_ref) ax_free(mem_ref, mem_debug_file, __LINE__) +#define SSL_MALLOC(size) ax_malloc(size, __FILE__, __LINE__) +#define SSL_REALLOC(mem_ref,size) ax_realloc(mem_ref, size, __FILE__, __LINE__) +#define SSL_CALLOC(element, size) ax_calloc(element, size, __FILE__, __LINE__) +#define SSL_ZALLOC(size) ax_zalloc(size, __FILE__, __LINE__) +#define SSL_FREE(mem_ref) ax_free(mem_ref, __FILE__, __LINE__) #else #define SSL_MALLOC(size) malloc(size) #define SSL_REALLOC(mem_ref,size) realloc(mem_ref, size) diff --git a/components/ssl/axtls/source/crypto/sha256.c b/components/ssl/axtls/source/crypto/sha256.c index 86eaf6dc..db6acaa9 100644 --- a/components/ssl/axtls/source/crypto/sha256.c +++ b/components/ssl/axtls/source/crypto/sha256.c @@ -35,10 +35,6 @@ //#include "crypto.h" #include "lwip/mem.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #define GET_UINT32(n,b,i) \ { \ (n) = ((uint32_t) (b)[(i) ] << 24) \ diff --git a/components/ssl/axtls/source/crypto/sha512.c b/components/ssl/axtls/source/crypto/sha512.c index bfd33fc8..232a5ccd 100644 --- a/components/ssl/axtls/source/crypto/sha512.c +++ b/components/ssl/axtls/source/crypto/sha512.c @@ -44,10 +44,6 @@ #define SIGMA3(x) (ROR64(x, 1) ^ ROR64(x, 8) ^ SHR64(x, 7)) #define SIGMA4(x) (ROR64(x, 19) ^ ROR64(x, 61) ^ SHR64(x, 6)) #define MIN(x, y) ((x) < (y) ? x : y) - -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif static const uint8_t padding[128] = { diff --git a/components/ssl/axtls/source/crypto/ssl_aes.c b/components/ssl/axtls/source/crypto/ssl_aes.c index 381a213b..eb696ae7 100644 --- a/components/ssl/axtls/source/crypto/ssl_aes.c +++ b/components/ssl/axtls/source/crypto/ssl_aes.c @@ -40,10 +40,6 @@ /* all commented out in skeleton mode */ #ifndef CONFIG_SSL_SKELETON_MODE -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #define rot1(x) (((x) << 24) | ((x) >> 8)) #define rot2(x) (((x) << 16) | ((x) >> 16)) #define rot3(x) (((x) << 8) | ((x) >> 24)) diff --git a/components/ssl/axtls/source/crypto/ssl_bigint.c b/components/ssl/axtls/source/crypto/ssl_bigint.c index f468260f..9db81df2 100644 --- a/components/ssl/axtls/source/crypto/ssl_bigint.c +++ b/components/ssl/axtls/source/crypto/ssl_bigint.c @@ -63,10 +63,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_bigint.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #define V1 v->comps[v->size-1] /**< v1 for division */ #define V2 v->comps[v->size-2] /**< v2 for division */ #define U(j) tmp_u->comps[tmp_u->size-j-1] /**< uj for division */ diff --git a/components/ssl/axtls/source/crypto/ssl_crypto_misc.c b/components/ssl/axtls/source/crypto/ssl_crypto_misc.c index abb60738..1dad10a7 100644 --- a/components/ssl/axtls/source/crypto/ssl_crypto_misc.c +++ b/components/ssl/axtls/source/crypto/ssl_crypto_misc.c @@ -43,10 +43,6 @@ #include "wincrypt.h" #endif -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #ifndef WIN32 //static int rng_fd = -1; #elif defined(CONFIG_WIN32_USE_CRYPTO_LIB) diff --git a/components/ssl/axtls/source/crypto/ssl_hmac.c b/components/ssl/axtls/source/crypto/ssl_hmac.c index 0c488f22..2d95b9a2 100644 --- a/components/ssl/axtls/source/crypto/ssl_hmac.c +++ b/components/ssl/axtls/source/crypto/ssl_hmac.c @@ -37,10 +37,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_crypto.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - /** * Perform HMAC-MD5 * NOTE: does not handle keys larger than the block size. diff --git a/components/ssl/axtls/source/crypto/ssl_rsa.c b/components/ssl/axtls/source/crypto/ssl_rsa.c index c1707d9c..a3ad15f1 100644 --- a/components/ssl/axtls/source/crypto/ssl_rsa.c +++ b/components/ssl/axtls/source/crypto/ssl_rsa.c @@ -36,10 +36,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_crypto.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - void ICACHE_FLASH_ATTR RSA_priv_key_new(RSA_CTX **ctx, const uint8_t *modulus, int mod_len, const uint8_t *pub_exp, int pub_len, diff --git a/components/ssl/axtls/source/ssl/ssl_asn1.c b/components/ssl/axtls/source/ssl/ssl_asn1.c index e520d695..37f79f82 100644 --- a/components/ssl/axtls/source/ssl/ssl_asn1.c +++ b/components/ssl/axtls/source/ssl/ssl_asn1.c @@ -37,10 +37,6 @@ #include "ssl/ssl_crypto.h" #include "ssl/ssl_crypto_misc.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - struct tm { int tm_sec; /* Seconds. [0-60] (1 leap second) */ diff --git a/components/ssl/axtls/source/ssl/ssl_gen_cert.c b/components/ssl/axtls/source/ssl/ssl_gen_cert.c index 43e2dcdb..9b1100e7 100644 --- a/components/ssl/axtls/source/ssl/ssl_gen_cert.c +++ b/components/ssl/axtls/source/ssl/ssl_gen_cert.c @@ -36,10 +36,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_ssl.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - /** * Generate a basic X.509 certificate */ diff --git a/components/ssl/axtls/source/ssl/ssl_loader.c b/components/ssl/axtls/source/ssl/ssl_loader.c index 27782dae..650f9f08 100644 --- a/components/ssl/axtls/source/ssl/ssl_loader.c +++ b/components/ssl/axtls/source/ssl/ssl_loader.c @@ -41,10 +41,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_ssl.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - static int do_obj(SSL_CTX *ssl_ctx, int obj_type, SSLObjLoader *ssl_obj, const char *password); #ifdef CONFIG_SSL_HAS_PEM diff --git a/components/ssl/axtls/source/ssl/ssl_openssl.c b/components/ssl/axtls/source/ssl/ssl_openssl.c index f4656a6f..bb5427c3 100644 --- a/components/ssl/axtls/source/ssl/ssl_openssl.c +++ b/components/ssl/axtls/source/ssl/ssl_openssl.c @@ -45,10 +45,6 @@ #include "ssl/ssl_os_port.h" #include "ssl/ssl_ssl.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #define OPENSSL_CTX_ATTR ((OPENSSL_CTX *)ssl_ctx->bonus_attr) static char *key_password = NULL; diff --git a/components/ssl/axtls/source/ssl/ssl_os_port.c b/components/ssl/axtls/source/ssl/ssl_os_port.c index 182c7872..562d154a 100644 --- a/components/ssl/axtls/source/ssl/ssl_os_port.c +++ b/components/ssl/axtls/source/ssl/ssl_os_port.c @@ -37,10 +37,6 @@ #include "ssl/ssl_os_port.h" #include "lwip/sockets.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #ifdef WIN32 /** * gettimeofday() not in Win32 diff --git a/components/ssl/axtls/source/ssl/ssl_p12.c b/components/ssl/axtls/source/ssl/ssl_p12.c index e7a85d5f..658524f3 100644 --- a/components/ssl/axtls/source/ssl/ssl_p12.c +++ b/components/ssl/axtls/source/ssl/ssl_p12.c @@ -65,10 +65,6 @@ /* all commented out if not used */ #ifdef CONFIG_SSL_USE_PKCS12 -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #define BLOCK_SIZE 64 #define PKCS12_KEY_ID 1 #define PKCS12_IV_ID 2 diff --git a/components/ssl/axtls/source/ssl/ssl_platform.c b/components/ssl/axtls/source/ssl/ssl_platform.c index eff9f983..da7beb21 100644 --- a/components/ssl/axtls/source/ssl/ssl_platform.c +++ b/components/ssl/axtls/source/ssl/ssl_platform.c @@ -38,10 +38,6 @@ #include "ssl/ssl_platform.h" #include "lwip/err.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - /****************************************************************************** * FunctionName : esp_EVP_DigestInit * Description : sent data for client or server diff --git a/components/ssl/axtls/source/ssl/ssl_tls1.c b/components/ssl/axtls/source/ssl/ssl_tls1.c index 24cdcf69..e83cd63d 100644 --- a/components/ssl/axtls/source/ssl/ssl_tls1.c +++ b/components/ssl/axtls/source/ssl/ssl_tls1.c @@ -37,10 +37,6 @@ #include "lwip/sockets.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - /* The session expiry time */ #define SSL_EXPIRY_TIME (CONFIG_SSL_EXPIRY_TIME*3600) diff --git a/components/ssl/axtls/source/ssl/ssl_tls1_svr.c b/components/ssl/axtls/source/ssl/ssl_tls1_svr.c index 7f043333..fd26141f 100644 --- a/components/ssl/axtls/source/ssl/ssl_tls1_svr.c +++ b/components/ssl/axtls/source/ssl/ssl_tls1_svr.c @@ -33,10 +33,6 @@ static const uint8_t g_hello_done[] = { HS_SERVER_HELLO_DONE, 0, 0, 0 }; -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - static int process_client_hello(SSL *ssl); static int send_server_hello_sequence(SSL *ssl); static int send_server_hello(SSL *ssl); diff --git a/components/ssl/axtls/source/ssl/ssl_x509.c b/components/ssl/axtls/source/ssl/ssl_x509.c index f4f3a36a..d1e75690 100644 --- a/components/ssl/axtls/source/ssl/ssl_x509.c +++ b/components/ssl/axtls/source/ssl/ssl_x509.c @@ -40,10 +40,6 @@ #include "lwip/sockets.h" -#ifdef MEMLEAK_DEBUG -static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; -#endif - #ifdef CONFIG_SSL_CERT_VERIFICATION /** * Retrieve the signature from a certificate. diff --git a/components/ssl/mbedtls/port/openssl/include/internal/ssl_methods.h b/components/ssl/mbedtls/port/openssl/include/internal/ssl_methods.h index cd2f8c05..bd3b1640 100644 --- a/components/ssl/mbedtls/port/openssl/include/internal/ssl_methods.h +++ b/components/ssl/mbedtls/port/openssl/include/internal/ssl_methods.h @@ -32,7 +32,7 @@ set_bufflen, \ get_verify_result, \ get_state) \ - static const SSL_METHOD_FUNC func_name LOCAL_ATRR = { \ + static const SSL_METHOD_FUNC func_name = { \ new, \ free, \ handshake, \ @@ -50,7 +50,7 @@ #define IMPLEMENT_TLS_METHOD(ver, mode, fun, func_name) \ const SSL_METHOD* func_name(void) { \ - static const SSL_METHOD func_name##_data LOCAL_ATRR = { \ + static const SSL_METHOD func_name##_data = { \ ver, \ mode, \ &(fun), \ @@ -60,7 +60,7 @@ #define IMPLEMENT_SSL_METHOD(ver, mode, fun, func_name) \ const SSL_METHOD* func_name(void) { \ - static const SSL_METHOD func_name##_data LOCAL_ATRR = { \ + static const SSL_METHOD func_name##_data = { \ ver, \ mode, \ &(fun), \ @@ -74,7 +74,7 @@ load, \ show_info) \ const X509_METHOD* func_name(void) { \ - static const X509_METHOD func_name##_data LOCAL_ATRR = { \ + static const X509_METHOD func_name##_data = { \ new, \ free, \ load, \ @@ -88,7 +88,7 @@ free, \ load) \ const PKEY_METHOD* func_name(void) { \ - static const PKEY_METHOD func_name##_data LOCAL_ATRR = { \ + static const PKEY_METHOD func_name##_data = { \ new, \ free, \ load \ diff --git a/components/ssl/mbedtls/port/openssl/include/platform/ssl_port.h b/components/ssl/mbedtls/port/openssl/include/platform/ssl_port.h index 77ac7478..6481f15d 100644 --- a/components/ssl/mbedtls/port/openssl/include/platform/ssl_port.h +++ b/components/ssl/mbedtls/port/openssl/include/platform/ssl_port.h @@ -65,7 +65,5 @@ extern void vPortFree(void *pv); #define SSL_DEBUG_LOG printf -#define LOCAL_ATRR ICACHE_RODATA_ATTR STORE_ATTR - #endif