| 414 |
/* protect the heap from concurrent access */ |
/* protect the heap from concurrent access */ |
| 415 |
LWIP_MEM_FREE_PROTECT(); |
LWIP_MEM_FREE_PROTECT(); |
| 416 |
|
|
|
MEM_STATS_DEC_USED(used, (size - newsize)); |
|
|
|
|
| 417 |
mem2 = (struct mem *)&ram[mem->next]; |
mem2 = (struct mem *)&ram[mem->next]; |
| 418 |
if(mem2->used == 0) { |
if(mem2->used == 0) { |
| 419 |
/* The next struct is unused, we can simply move it at little */ |
/* The next struct is unused, we can simply move it at little */ |
| 439 |
if (mem2->next != MEM_SIZE_ALIGNED) { |
if (mem2->next != MEM_SIZE_ALIGNED) { |
| 440 |
((struct mem *)&ram[mem2->next])->prev = ptr2; |
((struct mem *)&ram[mem2->next])->prev = ptr2; |
| 441 |
} |
} |
| 442 |
|
MEM_STATS_DEC_USED(used, (size - newsize)); |
| 443 |
/* no need to plug holes, we've already done that */ |
/* no need to plug holes, we've already done that */ |
| 444 |
} else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) { |
} else if (newsize + SIZEOF_STRUCT_MEM + MIN_SIZE_ALIGNED <= size) { |
| 445 |
/* Next struct is used but there's room for another struct mem with |
/* Next struct is used but there's room for another struct mem with |
| 461 |
if (mem2->next != MEM_SIZE_ALIGNED) { |
if (mem2->next != MEM_SIZE_ALIGNED) { |
| 462 |
((struct mem *)&ram[mem2->next])->prev = ptr2; |
((struct mem *)&ram[mem2->next])->prev = ptr2; |
| 463 |
} |
} |
| 464 |
|
MEM_STATS_DEC_USED(used, (size - newsize)); |
| 465 |
/* the original mem->next is used, so no need to plug holes! */ |
/* the original mem->next is used, so no need to plug holes! */ |
| 466 |
} |
} |
| 467 |
/* else { |
/* else { |