Skip to content
Commit aeda6ccd authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Anas Nashif
Browse files

lib/os/heap: fix realloc issues



If the new size amounts to the same number of chunks then:

- If right-chunk is used then we needlessly allocate new memory and
  copy data over.

- If right-chunk is free then we attempt to split it with a zero size
  which corrupts the prev/next list.

Make sure this case is properly handled and add a test for it.

While at it, let's simplify the code somewhat as well.

Signed-off-by: default avatarNicolas Pitre <npitre@baylibre.com>
parent bb18fa0b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment