diff options
Diffstat (limited to 'src/mempool.c')
| -rw-r--r-- | src/mempool.c | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/src/mempool.c b/src/mempool.c index 5ac87d2bc8..09a4955eee 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -32,8 +32,8 @@ static void (*rt_mp_free_hook)(struct rt_mempool *mp, void *block); /**@{*/ /** - * This function will set a hook function, which will be invoked when a memory - * block is allocated from memory pool. + * @brief This function will set a hook function, which will be invoked when a memory + * block is allocated from the memory pool. * * @param hook the hook function */ @@ -43,8 +43,8 @@ void rt_mp_alloc_sethook(void (*hook)(struct rt_mempool *mp, void *block)) } /** - * This function will set a hook function, which will be invoked when a memory - * block is released to memory pool. + * @brief This function will set a hook function, which will be invoked when a memory + * block is released to the memory pool. * * @param hook the hook function */ @@ -63,14 +63,18 @@ void rt_mp_free_sethook(void (*hook)(struct rt_mempool *mp, void *block)) /**@{*/ /** - * 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 name the name of memory pool - * @param start the star address of memory pool - * @param size the total size of memory pool - * @param block_size the size for each block + * @param mp is the memory pool object. + * + * @param name is the name of the memory pool. + * + * @param start is the start address of the memory pool. + * + * @param size is the total size of the memory pool. + * + * @param block_size is the size for each block.. * * @return RT_EOK */ @@ -125,9 +129,9 @@ rt_err_t rt_mp_init(struct rt_mempool *mp, RTM_EXPORT(rt_mp_init); /** - * 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 */ @@ -172,12 +176,14 @@ RTM_EXPORT(rt_mp_detach); #ifdef RT_USING_HEAP /** - * This function will create a mempool object and allocate the memory pool from - * heap. + * @brief This function will create a mempool object and allocate the memory pool from + * heap. * - * @param name the name of memory pool - * @param block_count the count of blocks in memory pool - * @param block_size the size for each block + * @param name is the name of memory pool. + * + * @param block_count is the count of blocks in memory pool. + * + * @param block_size is the size for each block. * * @return the created mempool object */ @@ -241,9 +247,9 @@ rt_mp_t rt_mp_create(const char *name, RTM_EXPORT(rt_mp_create); /** - * This function will delete a memory pool and release the object memory. + * @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 */ @@ -293,12 +299,14 @@ RTM_EXPORT(rt_mp_delete); #endif /* RT_USING_HEAP */ /** - * This function will allocate a block from memory pool + * @brief This function will allocate a block from memory pool. + * + * @param mp is the memory pool object. * - * @param mp 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 + * @return the allocated memory block or RT_NULL on allocated failed. */ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time) { @@ -392,9 +400,9 @@ void *rt_mp_alloc(rt_mp_t mp, rt_int32_t time) RTM_EXPORT(rt_mp_alloc); /** - * 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) { |
