FreeRTOS提供了5种内存管理实现,具体使用的哪一种,要看编译指定
使用的FreedomStudio 软件
示例freertos_minimal/src/Makefile
Makefile 中export HEAP = 4
在freertos_minimal/FreeRTOS-metal/scripts/FreeRTOS_core_mk 中
ifeq ($(HEAP),1)
override C_SOURCES += $(SOURCE_DIR)/portable/MemMang/heap_1.c
else ifeq ($(HEAP),2)
override C_SOURCES += $(SOURCE_DIR)/portable/MemMang/heap_2.c
else ifeq ($(HEAP),3)
override C_SOURCES += $(SOURCE_DIR)/portable/MemMang/heap_3.c
else ifeq ($(HEAP),4)
override C_SOURCES += $(SOURCE_DIR)/portable/MemMang/heap_4.c
else ifeq ($(HEAP),5)
override C_SOURCES += $(SOURCE_DIR)/portable/MemMang/heap_5.c
else
ERR = $(error No heap management selected)
endif
根据宏值选择编译不同的heap文件