mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 21:56:45 +08:00
Addition to patch #5913: decrease size of memp_memory.
Added option MEMP_OVERFLOW_CHECK to check for memp elements to overflow.
This commit is contained in:
@@ -62,7 +62,12 @@ typedef enum {
|
||||
|
||||
void memp_init(void);
|
||||
|
||||
#if MEMP_OVERFLOW_CHECK
|
||||
void *memp_malloc_fn(memp_t type, const char* file, const int line);
|
||||
#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
|
||||
#else
|
||||
void *memp_malloc(memp_t type);
|
||||
#endif
|
||||
void memp_free(memp_t type, void *mem);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -84,8 +84,18 @@ a lot of data that needs to be copied, this should be set high. */
|
||||
#define MEM_SIZE 1600
|
||||
#endif
|
||||
|
||||
/* MEMP_OVERFLOW_CHECK: memp overflow protection
|
||||
* reserves a configurable amount of bytes before and after each memp
|
||||
* element in every pool and fills it with a prominent default value.
|
||||
* MEMP_OVERFLOW_CHECK = 1 checks each element when it is freed
|
||||
* MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
|
||||
* memp_malloc() or memp_free() is called (useful but slow!) */
|
||||
#ifndef MEMP_OVERFLOW_CHECK
|
||||
#define MEMP_OVERFLOW_CHECK 0
|
||||
#endif
|
||||
|
||||
#ifndef MEMP_SANITY_CHECK
|
||||
#define MEMP_SANITY_CHECK 0
|
||||
#define MEMP_SANITY_CHECK 0
|
||||
#endif
|
||||
|
||||
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
|
||||
|
||||
Reference in New Issue
Block a user