当前位置:网站首页>Introduction to RT thread kernel (5) -- memory management

Introduction to RT thread kernel (5) -- memory management

2022-07-05 04:20:00 Number and form

Basic concepts
There are two kinds of storage space in computer system , One is internal storage space RAM( Ram ) Fast access , External storage space ROM( read-only memory ) Stable stored data .

Two memory management algorithms
Static memory allocation algorithm : Allocate memory blocks of the preset size during user initialization in the static memory pool , Ensure the reliability of the equipment, but consider the upper limit of memory , Memory efficiency is low , Efficient distribution and use
Dynamic memory allocation algorithm : Allocate memory blocks of the size specified by the user in the dynamic memory pool , High memory efficiency , Memory pools are prone to fragmentation

Dynamic memory management algorithm Small memory management algorithm and SLAB Memory management algorithm

Interface function of static memory management

Initialize memory pool :rt_mp_init
Out of memory pool :rt_thread_detach
Create a memory pool :rt_thread_create
Delete memory pool :rt_thread_delete
Static memory application function :rt_mp_alloc
j Static memory release function :rt_mp_free

Common interface functions for dynamic memory management :
Memory heap system initialization :rt_system_heap_init
Allocate memory blocks :rt_malloc
Free memory block :rt_free
Reallocate memory blocks :rt_realloc
Allocate multiple memory blocks :rt_calloc

原网站

版权声明
本文为[Number and form]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140646458729.html