179 |
struct memp *memp; |
struct memp *memp; |
180 |
void *mem; |
void *mem; |
181 |
|
|
182 |
ASSERT("memp_malloc: type < MEMP_MAX", type < MEMP_MAX); |
LWIP_ASSERT("memp_malloc: type < MEMP_MAX", type < MEMP_MAX); |
183 |
|
|
184 |
memp = memp_tab[type]; |
memp = memp_tab[type]; |
185 |
|
|
192 |
lwip_stats.memp[type].max = lwip_stats.memp[type].used; |
lwip_stats.memp[type].max = lwip_stats.memp[type].used; |
193 |
} |
} |
194 |
#endif /* MEMP_STATS */ |
#endif /* MEMP_STATS */ |
195 |
ASSERT("memp_malloc: memp properly aligned", |
LWIP_ASSERT("memp_malloc: memp properly aligned", |
196 |
((u32_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); |
((u32_t)MEM_ALIGN((u8_t *)memp + sizeof(struct memp)) % MEM_ALIGNMENT) == 0); |
197 |
|
|
198 |
mem = MEM_ALIGN((u8_t *)memp + sizeof(struct memp)); |
mem = MEM_ALIGN((u8_t *)memp + sizeof(struct memp)); |
245 |
memp->next = memp_tab[type]; |
memp->next = memp_tab[type]; |
246 |
memp_tab[type] = memp; |
memp_tab[type] = memp; |
247 |
|
|
248 |
ASSERT("memp sanity", memp_sanity()); |
LWIP_ASSERT("memp sanity", memp_sanity()); |
249 |
|
|
250 |
return; |
return; |
251 |
} |
} |