]> granicus.if.org Git - esp-idf/commit
Try to merge tail with next block when splitting
authorDeomid Ryabkov <rojer@cesanta.com>
Thu, 22 Mar 2018 14:58:20 +0000 (14:58 +0000)
committerAngus Gratton <gus@projectgus.com>
Tue, 3 Apr 2018 02:30:52 +0000 (12:30 +1000)
commit4b7eb1792e9e593fdb9e5c37cbf58d552f0761eb
treeba1f2dd916c855330dd5df937b5a312143592db5
parent393f3da37cee49c4658cee7d12a5536462099cb4
Try to merge tail with next block when splitting

When splitting a memory block, check if the next block is free.
If it is, then just extend it upwards instead of creating a new block.
This fixes a bug where when shrinking existing allocations would result in irreversible free space fragmentation.

When testing on the host, test all the poisoning configurations.
components/heap/multi_heap.c
components/heap/multi_heap_config.h
components/heap/multi_heap_poisoning.c
components/heap/test_multi_heap_host/Makefile
components/heap/test_multi_heap_host/Makefile.test [new file with mode: 0644]
components/heap/test_multi_heap_host/test_multi_heap.cpp