summaryrefslogtreecommitdiff
path: root/src/mempool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mempool.c')
-rw-r--r--src/mempool.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/mempool.c b/src/mempool.c
index 9b201c5f89..09a4955eee 100644
--- a/src/mempool.c
+++ b/src/mempool.c
@@ -33,7 +33,7 @@ static void (*rt_mp_free_hook)(struct rt_mempool *mp, void *block);
/**
* @brief This function will set a hook function, which will be invoked when a memory
- * block is allocated from memory pool.
+ * block is allocated from the memory pool.
*
* @param hook the hook function
*/
@@ -44,7 +44,7 @@ void rt_mp_alloc_sethook(void (*hook)(struct rt_mempool *mp, void *block))
/**
* @brief This function will set a hook function, which will be invoked when a memory
- * block is released to memory pool.
+ * block is released to the memory pool.
*
* @param hook the hook function
*/
@@ -63,18 +63,18 @@ void rt_mp_free_sethook(void (*hook)(struct rt_mempool *mp, void *block))
/**@{*/
/**
- * @brief This function will initialize a memory pool object, normally which is used
- * for static object.
+ * @brief This function will initialize a memory pool object, normally which is used
+ * for static object.
*
- * @param mp the memory pool object
+ * @param mp is the memory pool object.
*
- * @param name the name of memory pool
+ * @param name is the name of the memory pool.
*
- * @param start the star address of memory pool
+ * @param start is the start address of the memory pool.
*
- * @param size the total size of memory pool
+ * @param size is the total size of the memory pool.
*
- * @param block_size the size for each block
+ * @param block_size is the size for each block..
*
* @return RT_EOK
*/
@@ -129,9 +129,9 @@ rt_err_t rt_mp_init(struct rt_mempool *mp,
RTM_EXPORT(rt_mp_init);
/**
- * @brief This function will detach a memory pool from system object management.
+ * @brief This function will detach a memory pool from system object management.
*
- * @param mp the memory pool object.
+ * @param mp is the memory pool object.
*
* @return RT_EOK
*/
@@ -179,11 +179,11 @@ RTM_EXPORT(rt_mp_detach);
* @brief This function will create a mempool object and allocate the memory pool from
* heap.
*
- * @param name the name of memory pool
+ * @param name is the name of memory pool.
*
- * @param block_count the count of blocks in memory pool
+ * @param block_count is the count of blocks in memory pool.
*
- * @param block_size the size for each block
+ * @param block_size is the size for each block.
*
* @return the created mempool object
*/
@@ -249,7 +249,7 @@ RTM_EXPORT(rt_mp_create);
/**
* @brief This function will delete a memory pool and release the object memory.
*
- * @param mp the memory pool object.
+ * @param mp is the memory pool object.
*
* @return RT_EOK
*/
@@ -301,9 +301,10 @@ RTM_EXPORT(rt_mp_delete);
/**
* @brief This function will allocate a block from memory pool.
*
- * @param mp the memory pool object.
+ * @param mp is the memory pool object.
*
- * @param time the waiting time.
+ * @param time is the maximum waiting time for allocating memory.
+ * - 0 for not waiting, allocating memory immediately.
*
* @return the allocated memory block or RT_NULL on allocated failed.
*/
@@ -399,9 +400,9 @@ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time)
RTM_EXPORT(rt_mp_alloc);
/**
- * @brief This function will release a memory block
+ * @brief This function will release a memory block.
*
- * @param block the address of memory block to be released
+ * @param block the address of memory block to be released.
*/
void rt_mp_free(void *block)
{