From 2df636fe7773a5b9469ec3bc54ee8f7ed3e92dca Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 8 Jul 2016 10:06:01 +0200 Subject: [PATCH] memp: fixed STATS initialization --- src/core/memp.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/core/memp.c b/src/core/memp.c index 1ad26169..6448f418 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -222,6 +222,17 @@ memp_init_pool(const struct memp_desc *desc) #if MEMP_OVERFLOW_CHECK memp_overflow_init(desc); #endif /* MEMP_OVERFLOW_CHECK */ + +#if MEMP_STATS + desc->stats->used = 0; + desc->stats->max = 0; + desc->stats->err = 0; + desc->stats->illegal = 0; + desc->stats->avail = desc->num; + +#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY + desc->stats->name = desc->desc; +#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */ } /** @@ -238,17 +249,6 @@ memp_init(void) for (i = 0; i < LWIP_ARRAYSIZE(memp_pools); i++) { memp_init_pool(memp_pools[i]); -#if MEMP_STATS - memp_pools[i]->stats->used = 0; - memp_pools[i]->stats->max = 0; - memp_pools[i]->stats->err = 0; - memp_pools[i]->stats->illegal = 0; - memp_pools[i]->stats->avail = memp_pools[i]->num; - -#if defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY - memp_pools[i]->stats->name = memp_pools[i]->desc; -#endif /* defined(LWIP_DEBUG) || LWIP_STATS_DISPLAY */ - #if LWIP_STATS lwip_stats.memp[i] = memp_pools[i]->stats; #endif