149 |
|
|
150 |
|
|
151 |
if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { |
if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { |
152 |
DEBUGF(MEM_DEBUG, ("mem_free: illegal memory\n")); |
DEBUGF(MEM_DEBUG | 3, ("mem_free: illegal memory\n")); |
153 |
#ifdef MEM_STATS |
#ifdef MEM_STATS |
154 |
++lwip_stats.mem.err; |
++lwip_stats.mem.err; |
155 |
#endif /* MEM_STATS */ |
#endif /* MEM_STATS */ |
199 |
(u8_t *)rmem < (u8_t *)ram_end); |
(u8_t *)rmem < (u8_t *)ram_end); |
200 |
|
|
201 |
if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { |
if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) { |
202 |
DEBUGF(MEM_DEBUG, ("mem_realloc: illegal memory\n")); |
DEBUGF(MEM_DEBUG | 3, ("mem_realloc: illegal memory\n")); |
203 |
return rmem; |
return rmem; |
204 |
} |
} |
205 |
mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM); |
mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM); |
291 |
return (u8_t *)mem + SIZEOF_STRUCT_MEM; |
return (u8_t *)mem + SIZEOF_STRUCT_MEM; |
292 |
} |
} |
293 |
} |
} |
294 |
DEBUGF(MEM_DEBUG, ("mem_malloc: could not allocate %d bytes\n", (int)size)); |
DEBUGF(MEM_DEBUG | 2, ("mem_malloc: could not allocate %d bytes\n", (int)size)); |
295 |
#ifdef MEM_STATS |
#ifdef MEM_STATS |
296 |
++lwip_stats.mem.err; |
++lwip_stats.mem.err; |
297 |
#endif /* MEM_STATS */ |
#endif /* MEM_STATS */ |