malloc: Make tunable callback functions static
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
Since malloc tunable callback functions are only used within the same
file, we should make them static.
---
malloc/arena.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 06/05/2021 22:21, H.J. Lu via Libc-alpha wrote:
> Since malloc tunable callback functions are only used within the same
> file, we should make them static.
LGTM, thanks.
> ---
> malloc/arena.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/malloc/arena.c b/malloc/arena.c
> index 9fbbb38a15..7eb110445e 100644
> --- a/malloc/arena.c
> +++ b/malloc/arena.c
> @@ -207,7 +207,7 @@ __malloc_fork_unlock_child (void)
> }
>
> #if HAVE_TUNABLES
> -void
> +static void
> TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
> {
> int32_t value = (int32_t) valp->numval;
> @@ -217,7 +217,7 @@ TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
>
> # define TUNABLE_CALLBACK_FNDECL(__name, __type) \
> static inline int do_ ## __name (__type value); \
> -void \
> +static void \
> TUNABLE_CALLBACK (__name) (tunable_val_t *valp) \
> { \
> __type value = (__type) (valp)->numval; \
>
@@ -207,7 +207,7 @@ __malloc_fork_unlock_child (void)
}
#if HAVE_TUNABLES
-void
+static void
TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
{
int32_t value = (int32_t) valp->numval;
@@ -217,7 +217,7 @@ TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
# define TUNABLE_CALLBACK_FNDECL(__name, __type) \
static inline int do_ ## __name (__type value); \
-void \
+static void \
TUNABLE_CALLBACK (__name) (tunable_val_t *valp) \
{ \
__type value = (__type) (valp)->numval; \