If the chunk before sbrk(0) is free, extend it instead of creating a new chunk (which created two free chunks in sequence!)
When splitting a chunk, return first chunk, second is free. This also helps if the chunk before sbrk(0) is free since it leaves more space at the end, rather then creating a hole there.
This helps FreeCOM memory consumption greatly, from needing a heap > 8K to needing one of just under 5K, while still using the simple "first fit" allocation strategy.
There are three commits in here:
This helps FreeCOM memory consumption greatly, from needing a heap > 8K to needing one of just under 5K, while still using the simple "first fit" allocation strategy.