memp: Simplify implementation of memp_overflow_check_all

We don't really care the order of overflow/underflow checking because if
any checking fails we got assertion.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2016-01-15 18:30:21 +08:00 committed by Dirk Ziegelmeier
parent 11faa8149e
commit 70ebeda7ed

View File

@ -167,13 +167,6 @@ memp_overflow_check_all(void)
p = (struct memp *)(size_t)(memp_pools[i]->base);
for (j = 0; j < memp_pools[i]->num; ++j) {
memp_overflow_check_element_overflow(p, memp_pools[i]);
p = (struct memp*)(size_t)((u8_t*)p + MEMP_SIZE + memp_pools[i]->size + MEMP_SANITY_REGION_AFTER_ALIGNED);
}
}
for (i = 0; i < MEMP_MAX; ++i) {
p = (struct memp *)(size_t)(memp_pools[i]->base);
for (j = 0; j < memp_pools[i]->num; ++j) {
memp_overflow_check_element_underflow(p, memp_pools[i]);
p = (struct memp*)(size_t)((u8_t*)p + MEMP_SIZE + memp_pools[i]->size + MEMP_SANITY_REGION_AFTER_ALIGNED);
}