From a2d962d62c0a2d50d599ead4d70714331e086c44 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 31 Jul 2017 13:21:07 -0700 Subject: [PATCH] Remove unused ax_port_*alloc() functions The ax_port_malloc, ax_port_calloc, ax_port_realloc, and ax_port_free functions in WiFiClientSecure are not actually used by the AXTLS library. It's directly using the library routines, and these function are never used. Remove these dead bits of code to make the axtls operation clearer. --- .../ESP8266WiFi/src/WiFiClientSecure.cpp | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp index da7248fab6..5574f33975 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp @@ -638,53 +638,6 @@ extern "C" int __ax_get_file(const char *filename, uint8_t **buf) } extern "C" void ax_get_file() __attribute__ ((weak, alias("__ax_get_file"))); - -#ifdef DEBUG_TLS_MEM -#define DEBUG_TLS_MEM_PRINT(...) DEBUGV(__VA_ARGS__) -#else -#define DEBUG_TLS_MEM_PRINT(...) -#endif - -extern "C" void* ax_port_malloc(size_t size, const char* file, int line) -{ - (void) file; - (void) line; - void* result = malloc(size); - if (result == nullptr) { - DEBUG_TLS_MEM_PRINT("%s:%d malloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap()); - } - if (size >= 1024) { - DEBUG_TLS_MEM_PRINT("%s:%d malloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap()); - } - return result; -} - -extern "C" void* ax_port_calloc(size_t size, size_t count, const char* file, int line) -{ - void* result = ax_port_malloc(size * count, file, line); - memset(result, 0, size * count); - return result; -} - -extern "C" void* ax_port_realloc(void* ptr, size_t size, const char* file, int line) -{ - (void) file; - (void) line; - void* result = realloc(ptr, size); - if (result == nullptr) { - DEBUG_TLS_MEM_PRINT("%s:%d realloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap()); - } - if (size >= 1024) { - DEBUG_TLS_MEM_PRINT("%s:%d realloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap()); - } - return result; -} - -extern "C" void ax_port_free(void* ptr) -{ - free(ptr); -} - extern "C" void __ax_wdt_feed() { optimistic_yield(10000);