mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
mm/tlfs: Account initial size of struct mm_heap_s
and then initialize it. Signed-off-by: ganjing <ganjing@xiaomi.com>
This commit is contained in:
parent
af3d5e2212
commit
1c1cf74491
1 changed files with 5 additions and 1 deletions
|
|
@ -1033,6 +1033,9 @@ mm_initialize_heap(FAR const struct mm_heap_config_s *config)
|
|||
heap = (FAR struct mm_heap_s *)heapstart;
|
||||
heapstart += sizeof(struct mm_heap_s);
|
||||
heapsize -= sizeof(struct mm_heap_s);
|
||||
|
||||
memset(heap, 0, sizeof(struct mm_heap_s));
|
||||
heap->mm_curused = sizeof(struct mm_heap_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1041,9 +1044,10 @@ mm_initialize_heap(FAR const struct mm_heap_config_s *config)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(heap, 0, sizeof(struct mm_heap_s));
|
||||
}
|
||||
|
||||
memset(heap, 0, sizeof(struct mm_heap_s));
|
||||
heap->mm_nokasan = config->nokasan;
|
||||
|
||||
/* Allocate and create TLSF context */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue