memp: allow initialization of pool memory if not in standard section

This commit is contained in:
David Girault
2017-05-29 11:41:11 +02:00
committed by Dirk Ziegelmeier
parent 3aca7885a7
commit dc2bdc2a21
2 changed files with 17 additions and 0 deletions

View File

@@ -239,6 +239,14 @@ memp_init_pool(const struct memp_desc *desc)
*desc->tab = NULL;
memp = (struct memp*)LWIP_MEM_ALIGN(desc->base);
#if MEMP_MEM_INIT
/* force memset on pool memory */
memset(memp, 0, (size_t)desc->num * (MEMP_SIZE + desc->size
#if MEMP_OVERFLOW_CHECK
+ MEMP_SANITY_REGION_AFTER_ALIGNED
#endif
));
#endif
/* create a linked list of memp elements */
for (i = 0; i < desc->num; ++i) {
memp->next = *desc->tab;