diff options
| author | dejavudwh <[email protected]> | 2023-05-01 07:35:03 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-01 07:35:03 +0800 |
| commit | e12c2f9306825fc0f0f7b0e3c6b0b06c909b8a8c (patch) | |
| tree | 6c451c2bdd1214364f2b1c11294ab8a876e195e0 /src | |
| parent | d5800421459bec6cea97d5fc505ffa9b0c16b8e1 (diff) | |
[Better style] Unify the function declaration and definition paramete… (#7432)
Diffstat (limited to 'src')
| -rw-r--r-- | src/kservice.c | 16 |
1 files changed, 8 insertions, 8 deletions
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); } |
