mm/mm_extend: Increase total heap size accordingly
When adding more heap memory, the total heap size was not updated. This results in a crash in mm_mallinfo: DEBUGASSERT((size_t)info->uordblks + info->fordblks == heap->mm_heapsize); This commit fixes this issue
This commit is contained in:
parent
82550887c2
commit
6c2e0b7333
@ -106,6 +106,10 @@ void mm_extend(FAR struct mm_heap_s *heap, FAR void *mem, size_t size,
|
|||||||
newnode->preceding = oldnode->size | MM_ALLOC_BIT;
|
newnode->preceding = oldnode->size | MM_ALLOC_BIT;
|
||||||
|
|
||||||
heap->mm_heapend[region] = newnode;
|
heap->mm_heapend[region] = newnode;
|
||||||
|
|
||||||
|
/* Finally, increase the total heap size accordingly */
|
||||||
|
|
||||||
|
heap->mm_heapsize += size;
|
||||||
mm_unlock(heap);
|
mm_unlock(heap);
|
||||||
|
|
||||||
/* Finally "free" the new block of memory where the old terminal node was
|
/* Finally "free" the new block of memory where the old terminal node was
|
||||||
|
Loading…
Reference in New Issue
Block a user