1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Merge pull request #4150 from d-a-v/lwip

restore zalloc() + lower lwip2 ram and flash footprint
This commit is contained in:
david gauchard 2018-01-15 17:09:25 +01:00 committed by GitHub
commit 074402e23b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 6 deletions

View File

@ -43,7 +43,8 @@ bool ICACHE_FLASH_ATTR check_memleak_debug_enable(void)
#define os_malloc malloc
#define os_calloc calloc
#define os_realloc realloc
#define os_zalloc zalloc
#define os_zalloc(s) calloc(1,s)
#define zalloc(s) calloc(1,s)
#ifndef MEMLEAK_DEBUG
#define MEMLEAK_DEBUG_ENABLE 0

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,13 @@
```make install```: download, compile, install lwip2
make install download, compile, install lwip2
make download download lwIP-2 builder
make clean clean builder only
```make download```: download lwIP-2 builder
```make clean```: clean builder only
glue and lwIP debug options are in builder/glue/gluedebug.h
MSS values are in builder/Makefile.arduino
MSS values in boards.txt are only informative
current lwip2 submodule repository: https://github.com/d-a-v/esp82xx-nonos-linklayer/tree/arduino-2.4.0

@ -1 +1 @@
Subproject commit afc929779c7fcf23c6253f0cc71b1cf0bc83183f
Subproject commit 1b8826735cffa57d71ff6ce1fd79ec9d44a5215f

View File

@ -8,6 +8,7 @@
// this is needed separately from lwipopts.h
// because it is shared by both sides of glue
#define UNDEBUG 1 // 0 or 1 (1: uassert removed)
#define UDEBUG 0 // 0 or 1 (glue debug)
#define UDUMP 0 // 0 or 1 (glue / dump packet)
#define UDEBUGINDEX 0 // 0 or 1 (show debug line number)
@ -81,8 +82,22 @@ int doprint_minus (const char* format, ...) __attribute__ ((format (printf, 1, 2
#define uprint(x...) do { (void)0; } while (0)
#endif
#if UNDEBUG
#define uassert(assertion...) do { (void)0; } while (0)
#else // !defined(UNDEBUG)
#define uassert(assertion...) \
do { if ((assertion) == 0) { \
static const char assrt[] ICACHE_RODATA_ATTR STORE_ATTR = #assertion " wrong@"; \
os_printf_plus(assrt); \
static const char assrt_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
os_printf_plus(assrt_file); \
static const char assrt_line[] ICACHE_RODATA_ATTR STORE_ATTR = ":%d\n"; \
os_printf_plus(assrt_line, __LINE__); \
uhalt(); \
} } while (0)
#endif // !defined(UNDEBUG)
#define uerror(x...) do { doprint(x); } while (0)
#define uassert(assertion...) do { if ((assertion) == 0) { os_printf_plus("assert fail: " #assertion " @%s:%d\n", __FILE__, __LINE__); uhalt(); } } while (0)
#define uhalt() do { *((int*)0) = 0; /* this triggers gdb */ } while (0)
#define nl() do { uprint("\n"); } while (0)