Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lib][miniheap] fix: modify the assert condition in miniheap #438

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vivekj-samsung
Copy link

For LK_DEBUGLEVEL > 1

alloc_struct_begin_size: 24
free_heap_chunk_size: 24

size: max(alloc_struct_begin_size, free_heap_chunk_size)

But when freeing the chunk, allocated size is expected to be greater than size of free_heap_chunk struct.
It contradicts its own code.
So add >= instead of > to maintain the integrity between allocation and freeing of memory chunk.

For LK_DEBUGLEVEL > 1
> alloc_struct_begin_size: 24
> free_heap_chunk_size: 24

size: max(alloc_struct_begin_size, free_heap_chunk_size)

But when freeing the chunk, allocated size is expected to be
greater than size of free_heap_chunk struct.
It contradicts its own code.
So add >= instead of > to maintain the integrity between
allocation and freeing of memory chunk.

Signed-off-by: vivek.j <[email protected]>
@vivekj-samsung
Copy link
Author

Hi @travisg

Could you please review this pull request when you have time?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant