zephyr/tests/lib
Nicolas Pitre c227fe7b80 lib/os/heap: Correct aligned_alloc sizing for small heaps
The code that made aligned_alloc work with the 4-byte heap headers was
requesting a block of the correctly padded size, and correctly
aligning the output buffer within that memory, but it was using the
UNALIGNED chunk size for the buffer as the final size of the block
with splitting off the unused suffix.  So the final chunk in the
buffer was could be incorrectly returned to the heap and reused,
leading to overlap.

Compute the chunk size of the output buffer based on the
already-aligned output pointer instead.

Initial investigation and fix from Andy Ross <andrew.j.ross@intel.com>.
I reworked his fix, created a test case, and stolen his commit log.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-10-23 12:52:04 -04:00
..
c_lib
cmsis_dsp
devicetree/api devicetree: add first round of dependency ordinal info 2020-10-14 13:18:44 -05:00
fdtable
gui/lvgl
heap tests: heap: exclude on qemu_xtensa 2020-09-30 14:11:59 -04:00
heap_align lib/os/heap: Correct aligned_alloc sizing for small heaps 2020-10-23 12:52:04 -04:00
json
mem_alloc tests: mem_alloc: workaround aggressive optimization 2020-10-06 11:41:23 -04:00
notify
onoff tests: onoff: use typedef for spinlock key 2020-10-06 19:56:51 -04:00
ringbuffer Tests: ringbuffer: Improve the description cases 2020-10-14 07:43:39 -04:00
sprintf