From e12c2f9306825fc0f0f7b0e3c6b0b06c909b8a8c Mon Sep 17 00:00:00 2001 From: dejavudwh <494319000@qq.com> Date: Mon, 1 May 2023 07:35:03 +0800 Subject: [Better style] Unify the function declaration and definition paramete… (#7432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kservice.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/kservice.c b/src/kservice.c index ecae2f72ec..6638173f2d 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1692,13 +1692,13 @@ RTM_EXPORT(rt_malloc); /** * @brief This function will change the size of previously allocated memory block. * - * @param rmem is the pointer to memory allocated by rt_malloc. + * @param ptr is the pointer to memory allocated by rt_malloc. * * @param newsize is the required new size. * * @return the changed memory block address. */ -rt_weak void *rt_realloc(void *rmem, rt_size_t newsize) +rt_weak void *rt_realloc(void *ptr, rt_size_t newsize) { rt_base_t level; void *nptr; @@ -1706,7 +1706,7 @@ rt_weak void *rt_realloc(void *rmem, rt_size_t newsize) /* Enter critical zone */ level = _heap_lock(); /* Change the size of previously allocated memory block */ - nptr = _MEM_REALLOC(rmem, newsize); + nptr = _MEM_REALLOC(ptr, newsize); /* Exit critical zone */ _heap_unlock(level); return nptr; @@ -1745,19 +1745,19 @@ RTM_EXPORT(rt_calloc); * @brief This function will release the previously allocated memory block by * rt_malloc. The released memory block is taken back to system heap. * - * @param rmem the address of memory which will be released. + * @param ptr the address of memory which will be released. */ -rt_weak void rt_free(void *rmem) +rt_weak void rt_free(void *ptr) { rt_base_t level; /* call 'rt_free' hook */ - RT_OBJECT_HOOK_CALL(rt_free_hook, (rmem)); + RT_OBJECT_HOOK_CALL(rt_free_hook, (ptr)); /* NULL check */ - if (rmem == RT_NULL) return; + if (ptr == RT_NULL) return; /* Enter critical zone */ level = _heap_lock(); - _MEM_FREE(rmem); + _MEM_FREE(ptr); /* Exit critical zone */ _heap_unlock(level); } -- cgit v1.3.1