|
|
|
|
@ -454,6 +454,9 @@ void
|
|
|
|
|
memp_free(memp_t type, void *mem) |
|
|
|
|
{ |
|
|
|
|
struct memp *memp; |
|
|
|
|
#ifdef LWIP_HOOK_MEMP_AVAILABLE |
|
|
|
|
struct memp *old_first; |
|
|
|
|
#endif |
|
|
|
|
SYS_ARCH_DECL_PROTECT(old_level); |
|
|
|
|
|
|
|
|
|
if (mem == NULL) { |
|
|
|
|
@ -474,9 +477,12 @@ memp_free(memp_t type, void *mem)
|
|
|
|
|
#endif /* MEMP_OVERFLOW_CHECK >= 2 */ |
|
|
|
|
#endif /* MEMP_OVERFLOW_CHECK */ |
|
|
|
|
|
|
|
|
|
MEMP_STATS_DEC(used, type);
|
|
|
|
|
|
|
|
|
|
memp->next = memp_tab[type];
|
|
|
|
|
MEMP_STATS_DEC(used, type); |
|
|
|
|
|
|
|
|
|
memp->next = memp_tab[type]; |
|
|
|
|
#ifdef LWIP_HOOK_MEMP_AVAILABLE |
|
|
|
|
old_first = memp_tab[type]; |
|
|
|
|
#endif |
|
|
|
|
memp_tab[type] = memp; |
|
|
|
|
|
|
|
|
|
#if MEMP_SANITY_CHECK |
|
|
|
|
@ -484,6 +490,11 @@ memp_free(memp_t type, void *mem)
|
|
|
|
|
#endif /* MEMP_SANITY_CHECK */ |
|
|
|
|
|
|
|
|
|
SYS_ARCH_UNPROTECT(old_level); |
|
|
|
|
#ifdef LWIP_HOOK_MEMP_AVAILABLE |
|
|
|
|
if (old_first == NULL) { |
|
|
|
|
LWIP_HOOK_MEMP_AVAILABLE(type); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif /* MEMP_MEM_MALLOC */ |
|
|
|
|
|