memp_std.h: fix LWIP_PBUF_MEMPOOL element size for MEMP_OVERFLOW_CHECK

The LWIP_PBUF_MEMPOOL define used MEMP_ALIGN_SIZE instead of
LWIP_MEM_ALIGN_SIZE to calculate the element size of PBUF_POOL pbufs.
This is wrong for MEMP_OVERFLOW_CHECK, since MEMP_ALIGN_SIZE adds
MEMP_SANITY_REGION_AFTER_ALIGNED. This should be only added during
pool_base buffer allocation but for PBUF_POOL, it changed the size
of the pool elements.
This commit is contained in:
goldsimon 2018-01-17 12:51:49 +01:00
parent d12d6abae8
commit 2fd2b6810e

View File

@ -28,7 +28,7 @@
#ifndef LWIP_PBUF_MEMPOOL #ifndef LWIP_PBUF_MEMPOOL
/* This treats "pbuf pools" just like any other pool. /* This treats "pbuf pools" just like any other pool.
* Allocates buffers for a pbuf struct AND a payload size */ * Allocates buffers for a pbuf struct AND a payload size */
#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc) #define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) + LWIP_MEM_ALIGN_SIZE(payload)), desc)
#endif /* LWIP_PBUF_MEMPOOL */ #endif /* LWIP_PBUF_MEMPOOL */