freertos_f407/User/system/sgl/mm/lm.cfg

67 lines
2.7 KiB
INI

# source/mm/lm.cfg
#
# MIT License
#
# Copyright(c) 2023-present All contributors of SGL
# Document reference link: https://sgl-docs.readthedocs.io
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# Memory management
# Description:
# - tlsf
# A dynamic, fragmentation-resistant allocator designed for real-time and embedded systems
# (e.g., RTOS, MCUs with moderate RAM). It balances speed, memory utilization, and low fragmentation.
#
# - lwmem
# A lightweight, MCU-optimized allocator (developed for embedded systems) that prioritizes minimal
# resource usage (RAM/ROM) while supporting basic dynamic allocation/deallocation.
#
# - bump
# The simplest and fastest memory allocator, often called a "linear allocator" or "stack allocator"
# (though not to be confused with the program stack). It manages a single contiguous block of
# memory (a memory pool) with a single pointer (offset) that "bumps forward" to allocate memory.
#
# - other
# Other memory allocation algorithms, you can implement your own memory allocation algorithm.
# If you want to use dynamic memory allocation algorithm, you can consider it as an option
CONFIG_SGL_HEAP_ALGO
choices = tlsf, lwmem, bump, other
default = lwmem
CONFIG_SGL_FL_INDEX_MAX
choices = [10, 31]
depends = CONFIG_SGL_HEAP_ALGO
default = 20
# Memory size is Byte
CONFIG_SGL_HEAP_MEMORY_SIZE
choices = [1, 10000000]
depends = CONFIG_SGL_HEAP_ALGO
default = 10240
SRC-$(CONFIG_SGL_HEAP_ALGO == tlsf) += tlsf/tlsf.c tlsf/sgl_mm.c
SRC-$(CONFIG_SGL_HEAP_ALGO == lwmem) += lwmem/lwmem.c lwmem/sgl_mm.c
SRC-$(CONFIG_SGL_HEAP_ALGO == bump) += bump/sgl_mm.c
SRC-$(CONFIG_SGL_HEAP_ALGO == other) += other/sgl_mm.c