public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] malloc: Make tunable callback functions static
@ 2021-05-07  1:21 H.J. Lu
  2021-05-07 17:25 ` Adhemerval Zanella
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2021-05-07  1:21 UTC (permalink / raw)
  To: libc-alpha

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(-)

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;				      \
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] malloc: Make tunable callback functions static
  2021-05-07  1:21 [PATCH] malloc: Make tunable callback functions static H.J. Lu
@ 2021-05-07 17:25 ` Adhemerval Zanella
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella @ 2021-05-07 17:25 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha



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;				      \
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-07 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  1:21 [PATCH] malloc: Make tunable callback functions static H.J. Lu
2021-05-07 17:25 ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).