mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08: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:
+5
-1
@@ -1033,6 +1033,9 @@ mm_initialize_heap(FAR const struct mm_heap_config_s *config)
|
|||||||
heap = (FAR struct mm_heap_s *)heapstart;
|
heap = (FAR struct mm_heap_s *)heapstart;
|
||||||
heapstart += sizeof(struct mm_heap_s);
|
heapstart += sizeof(struct mm_heap_s);
|
||||||
heapsize -= 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
|
else
|
||||||
{
|
{
|
||||||
@@ -1041,9 +1044,10 @@ mm_initialize_heap(FAR const struct mm_heap_config_s *config)
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(heap, 0, sizeof(struct mm_heap_s));
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(heap, 0, sizeof(struct mm_heap_s));
|
|
||||||
heap->mm_nokasan = config->nokasan;
|
heap->mm_nokasan = config->nokasan;
|
||||||
|
|
||||||
/* Allocate and create TLSF context */
|
/* Allocate and create TLSF context */
|
||||||
|
|||||||
Reference in New Issue
Block a user