Repository navigation
alloc: Fix bug in handling first_free member of the block map - #2238
Conversation
3165b03 to
df12b09
Compare
|
Copy-pasting my explanation from the issue:
This pull request will ensure that first_free will point correctly in the last "picture" here. |
That field is intended to point to the first free block of this particular block map (part of heap). As long as the heap doesn't fill up the old code manages it correctly. However once the block map becomes full (all blocks are occupied) this member will no longer point to a free block. Without this fix rfree may fail to update this pointer to point to the correct block when freeing a block from a full heap. Not updating this will cause subsequent memory allocations to hand out used blocks as if they were free. This fix ensures that will not happen in this edge case. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
df12b09 to
5d4955f
Compare
|
@paulstelian97 thanks a lot for this change! With this I can no longer reproduce #2233 |
|
SOFCI TEST |
|
(Unit tests anyone?) |
|
Can't see any failing unit tests but the GH status says "Tests failed". Anyone who can actually see what happened can give me some feedback? |
I guess license server was down and it failed build cos of that... Anyway CI is green now all these errors were false negatives. |
That field is intended to point to the first free block of this
particular block map (part of heap). As long as the heap doesn't fill
up the old code manages it correctly.
However once the block map becomes full (all blocks are occupied)
this member will no longer point to a free block.
Without this fix rfree may fail to update this pointer to point to the
correct block when freeing a block from a full heap. Not updating this
will cause subsequent memory allocations to hand out used blocks as if
they were free. This fix ensures that will not happen in this edge case.
Signed-off-by: Paul Olaru paul.olaru@nxp.com
Fixes #2233