[12/26] locale: Call _nl_unload_locale from _nl_archive_subfreeres

Message ID 05452722425a257388ffa897973be6c1bb1d24c8.1647544751.git.fweimer@redhat.com
State Committed
Commit 0b6342e769be6903f29da067f5cbcbfcc7c01b10
Headers
Series vfprintf rework to remove vtables |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer March 17, 2022, 7:30 p.m. UTC
  The function performs the same teps for ld_archive locales
(mapped from an archive), and this code is not performance-critical,
so the specialization does not add vale.
---
 locale/loadarchive.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
  

Comments

Adhemerval Zanella Netto May 20, 2022, 6:09 p.m. UTC | #1
On 17/03/2022 16:30, Florian Weimer via Libc-alpha wrote:
> The function performs the same teps for ld_archive locales

s/teps/steps

> (mapped from an archive), and this code is not performance-critical,
> so the specialization does not add vale.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  locale/loadarchive.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/locale/loadarchive.c b/locale/loadarchive.c
> index e7c797bc70..5a2356707f 100644
> --- a/locale/loadarchive.c
> +++ b/locale/loadarchive.c
> @@ -515,13 +515,7 @@ _nl_archive_subfreeres (void)
>        free (dead->name);
>        for (category = 0; category < __LC_LAST; ++category)
>  	if (category != LC_ALL && dead->data[category] != NULL)
> -	  {
> -	    /* _nl_unload_locale just does this free for the archive case.  */
> -	    if (dead->data[category]->private.cleanup)
> -	      (*dead->data[category]->private.cleanup) (dead->data[category]);
> -
> -	    free (dead->data[category]);
> -	  }
> +	  _nl_unload_locale (dead->data[category]);
>        free (dead);
>      }
>    archloaded = NULL;
  
Florian Weimer May 23, 2022, 7:14 a.m. UTC | #2
* Adhemerval Zanella:

> On 17/03/2022 16:30, Florian Weimer via Libc-alpha wrote:
>> The function performs the same teps for ld_archive locales
>
> s/teps/steps
>
>> (mapped from an archive), and this code is not performance-critical,
>> so the specialization does not add vale.
>
> LGTM, thanks.
>
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Fixed (also “val[u]e”).

Thanks,
Florian
  

Patch

diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index e7c797bc70..5a2356707f 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -515,13 +515,7 @@  _nl_archive_subfreeres (void)
       free (dead->name);
       for (category = 0; category < __LC_LAST; ++category)
 	if (category != LC_ALL && dead->data[category] != NULL)
-	  {
-	    /* _nl_unload_locale just does this free for the archive case.  */
-	    if (dead->data[category]->private.cleanup)
-	      (*dead->data[category]->private.cleanup) (dead->data[category]);
-
-	    free (dead->data[category]);
-	  }
+	  _nl_unload_locale (dead->data[category]);
       free (dead);
     }
   archloaded = NULL;