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 <vivek.j@samsung.com>
Forgot to test at DEBUG=0. Both of these are basically cases where
the new DEBUG_ASSERT_COND should be used, since the default DEBUG_ASSERT
will now always emit code that gets cleaned up in the optimizer.
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.
See scripts/codestyle
From scratch simple binning heap. Complexity wise in the middle
between miniheap and dlmalloc. Generally much faster than miniheap
with a small amount of memory overhead. Performs similarly to
dlmalloc.
Add miniheap trim routine, which will attempt to free pages back to the
page allocator when called. Currently not called by anyone, unless
MINIHEAP_AUTOTRIM is set.
Flatten a level by moving malloc/free/new and friends into lib/heap.
Punch realloc and a few others directly through into the underlying
heap implementation. Remove heap_alloc and heap_free entirely.