summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangjie11 <[email protected]>2020-11-21 17:56:02 +0800
committeryangjie11 <[email protected]>2020-11-21 17:56:02 +0800
commitd79802b942e77389e1f885d9fe27a62434c652f9 (patch)
tree327f23a35917030902d77755ff699b883a189615
parent089c2dd106db4bd59427be04460e18221bb91e21 (diff)
[src][SConscript] Provide user heap options
-rw-r--r--src/Kconfig14
-rw-r--r--src/SConscript3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 63a7a67887..803c827e51 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -270,6 +270,18 @@ menu "Memory Management"
config RT_USING_MEMHEAP_AS_HEAP
bool "Use all of memheap objects as heap"
endif
+
+ config RT_USING_USERHEAP
+ bool "Use user heap"
+ help
+ If this option is selected, please implement these functions:
+ rt_malloc(), rt_malloc_sethook()
+ rt_free(), rt_free_sethook()
+ rt_calloc(), rt_realloc()
+ rt_system_heap_init()
+
+ And if FinSH is used at the same time, please implement list_mem()
+
endchoice
if RT_USING_SMALL_MEM
@@ -294,7 +306,7 @@ menu "Memory Management"
default y if RT_USING_SMALL_MEM
default y if RT_USING_SLAB
default y if RT_USING_MEMHEAP_AS_HEAP
-
+ default y if RT_USING_USERHEAP
endmenu
menu "Kernel Device Object"
diff --git a/src/SConscript b/src/SConscript
index c03d997cd1..806cdef2c5 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -23,6 +23,9 @@ if GetDepend('RT_USING_MEMHEAP') == False:
if GetDepend('RT_USING_MEMHEAP_AS_HEAP'):
SrcRemove(src, ['mem.c'])
+if GetDepend('RT_USING_USERHEAP'):
+ SrcRemove(src, ['mem.c', 'slab.c', 'memheap.c'])
+
if GetDepend('RT_USING_DEVICE') == False:
SrcRemove(src, ['device.c'])