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:
parent
635cfadc25
commit
874ecbe2f3
17
mm/Kconfig
17
mm/Kconfig
@ -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 fail
|
||||||
|
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
|
||||||
|
@ -20,6 +20,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
|
||||||
@ -38,3 +40,5 @@ endif
|
|||||||
|
|
||||||
DEPPATH += --dep-path mm_heap
|
DEPPATH += --dep-path mm_heap
|
||||||
VPATH += :mm_heap
|
VPATH += :mm_heap
|
||||||
|
|
||||||
|
endif # CONFIG_MM_DEFAULT_MANAGER
|
||||||
|
Loading…
Reference in New Issue
Block a user