mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
mm: add kconfig option to control the memory manger strategy choice.
since will will porvide more the one strategy in future. Change-Id: I73b900c6571f9b71b8239dd72006bdd0a68ee64d
This commit is contained in:
+17
@@ -3,6 +3,23 @@
|
|||||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Build heap manager"
|
||||||
|
default MM_DEFAULT_MANAGER
|
||||||
|
|
||||||
|
config MM_DEFAULT_MANAGER
|
||||||
|
bool "Default heap manager"
|
||||||
|
---help---
|
||||||
|
NuttX original memory manager strategy.
|
||||||
|
|
||||||
|
config MM_CUSTOMIZE_MANAGER
|
||||||
|
bool "Customized heap manager"
|
||||||
|
---help---
|
||||||
|
Customized memory manger policy. The build will failed
|
||||||
|
if the MM heap module not defined by customer.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
config MM_KERNEL_HEAP
|
config MM_KERNEL_HEAP
|
||||||
bool "Support a protected, kernel heap"
|
bool "Support a protected, kernel heap"
|
||||||
default y
|
default y
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
# Core heap allocator logic
|
# Core heap allocator logic
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_MM_DEFAULT_MANAGER),y)
|
||||||
|
|
||||||
CSRCS += mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c
|
CSRCS += mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c
|
||||||
CSRCS += mm_malloc_usable_size.c mm_shrinkchunk.c
|
CSRCS += mm_malloc_usable_size.c mm_shrinkchunk.c
|
||||||
CSRCS += mm_brkaddr.c mm_calloc.c mm_extend.c mm_free.c mm_mallinfo.c
|
CSRCS += mm_brkaddr.c mm_calloc.c mm_extend.c mm_free.c mm_mallinfo.c
|
||||||
@@ -53,3 +55,5 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path mm_heap
|
DEPPATH += --dep-path mm_heap
|
||||||
VPATH += :mm_heap
|
VPATH += :mm_heap
|
||||||
|
|
||||||
|
endif # CONFIG_MM_DEFAULT_MANAGER
|
||||||
|
|||||||
Reference in New Issue
Block a user