1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Merge pull request #1314 from gtalusan/master

fix undefined DEBUG_TLS_MEM_PRINT hiding return statement
This commit is contained in:
Markus 2015-12-28 13:59:34 +01:00
commit 4b90db41fe

View File

@ -493,8 +493,9 @@ extern "C" void* ax_port_malloc(size_t size, const char* file, int line) {
DEBUG_TLS_MEM_PRINT("%s:%d malloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap()); DEBUG_TLS_MEM_PRINT("%s:%d malloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap());
panic(); panic();
} }
if (size >= 1024) if (size >= 1024) {
DEBUG_TLS_MEM_PRINT("%s:%d malloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap()); DEBUG_TLS_MEM_PRINT("%s:%d malloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap());
}
return result; return result;
} }
@ -510,8 +511,9 @@ extern "C" void* ax_port_realloc(void* ptr, size_t size, const char* file, int l
DEBUG_TLS_MEM_PRINT("%s:%d realloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap()); DEBUG_TLS_MEM_PRINT("%s:%d realloc %d failed, left %d\r\n", file, line, size, ESP.getFreeHeap());
panic(); panic();
} }
if (size >= 1024) if (size >= 1024) {
DEBUG_TLS_MEM_PRINT("%s:%d realloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap()); DEBUG_TLS_MEM_PRINT("%s:%d realloc %d, left %d\r\n", file, line, size, ESP.getFreeHeap());
}
return result; return result;
} }
@ -519,6 +521,7 @@ extern "C" void ax_port_free(void* ptr) {
free(ptr); free(ptr);
uint32_t *p = (uint32_t*) ptr; uint32_t *p = (uint32_t*) ptr;
size_t size = p[-3]; size_t size = p[-3];
if (size >= 1024) if (size >= 1024) {
DEBUG_TLS_MEM_PRINT("free %d, left %d\r\n", p[-3], ESP.getFreeHeap()); DEBUG_TLS_MEM_PRINT("free %d, left %d\r\n", p[-3], ESP.getFreeHeap());
} }
}