CMSIS_5/cmsis_os2_MemPool.txt at develop · ARM-software/CMSIS_5 (github.com)
这种横条注释
[C] 纯文本查看 复制代码 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
[C] 纯文本查看 复制代码 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
// ==== Memory Pool Management ====
/**
\addtogroup CMSIS_RTOS_PoolMgmt Memory Pool
\ingroup CMSIS_RTOS
\brief Manage thread-safe fixed-size blocks of dynamic memory.
\details
\b Memory \b Pools are fixed-size blocks of memory that are thread-safe. They operate much faster than the dynamically
allocated heap and do not suffer from fragmentation. Being thread-safe, they can be accessed from threads and ISRs alike.
A Memory Pool can be seen as a linked list of available (unused) memory blocks of fixed and equal size. Allocating memory
from a pool (using \ref osMemoryPoolAlloc) simply unchains a block from the list and hands over control to the user. Freeing
memory to the pool (using \ref osMemoryPoolFree) simply rechains the block into the list.
\image html "mempool.png" "CMSIS-RTOS Memory Pools"
\note One must not write to freed block. It is up to the implementation to reuse the memory of unused blocks for internal
control data, i.e. linked list pointers.
\b Shared \b memory is one of the basic models to exchange information between threads. Using memory pools for exchanging
data, you can share more complex objects between threads if compared to a \ref CMSIS_RTOS_Message. Memory pool management
functions are used to define and manage such fixed-sized memory pools.
\note The functions \ref osMemoryPoolAlloc, \ref osMemoryPoolFree, \ref osMemoryPoolGetCapacity,
\ref osMemoryPoolGetBlockSize, \ref osMemoryPoolGetCount, \ref osMemoryPoolGetSpace can be called from
\ref CMSIS_RTOS_ISR_Calls "Interrupt Service Routines".
\note Refer to \ref memPoolConfig for RTX5 configuration options.
@{
*/
/*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
/**
\typedef osMemoryPoolId_t
\details
Returned by:
- \ref osMemoryPoolNew
*/
/**
\struct osMemoryPoolAttr_t
\details
Attributes to configure a memory pool.
Refer to \ref CMSIS_RTOS_MemoryMgmt for details about usage of
- osMemoryPoolAttr_t::cb_mem
- osMemoryPoolAttr_t::cb_size
- osMemoryPoolAttr_t::mp_mem
- osMemoryPoolAttr_t::mp_size
*/
一方面可以分界函数段落,又可以方便查看函数或者注释过长,当然很多编辑器已经支持了这种边界设置。
|