lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] memp_overflow_check_element_overflow assertion in debug


From: Axel Lin
Subject: Re: [lwip-devel] memp_overflow_check_element_overflow assertion in debug build (MEMP_OVERFLOW_CHECK=2)
Date: Thu, 3 Nov 2016 20:45:36 +0800

> Above are print by adding debug code in memp_init_pool:
>
> void
> memp_init_pool(const struct memp_desc *desc)
> {
> #if MEMP_MEM_MALLOC
>   LWIP_UNUSED_ARG(desc);
> #else
>   int i;
>   struct memp *memp;
>
>   *desc->tab = NULL;
> LWIP_PLATFORM_DIAG(("MEM_ALIGNMENT:%u MEMP_SIZE:%u
> MEMP_SANITY_REGION_AFTER_ALIGNED:%u\r\n",
>                 MEM_ALIGNMENT, MEMP_SIZE, MEMP_SANITY_REGION_AFTER_ALIGNED));
>   memp = (struct memp*)LWIP_MEM_ALIGN(desc->base);
> LWIP_PLATFORM_DIAG(("memp:%p   desc->base:%p desc->size:%u\r\n", (void
> *)memp, (void *) desc->base, (unsigned) desc->size));
>   /* create a linked list of memp elements */
>   for (i = 0; i < desc->num; ++i) {
>     memp->next = *desc->tab;
>     *desc->tab = memp;
> #if MEMP_OVERFLOW_CHECK
>     memp_overflow_init_element(memp, desc);
> #endif /* MEMP_OVERFLOW_CHECK */
>    /* cast through void* to get rid of alignment warnings */
>    memp = (struct memp *)(void *)((u8_t *)memp + MEMP_SIZE + desc->size
> #if MEMP_OVERFLOW_CHECK
>       + MEMP_SANITY_REGION_AFTER_ALIGNED
> #endif
>     );
> LWIP_PLATFORM_DIAG(("memp(%d):%p\r\n", i, (void *)memp));

Oops, I found I put the debug print at wrong place.
Please ignore above log.
I'll double check again.

Axel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]