about summary refs log tree commit diff
path: root/intl
diff options
context:
space:
mode:
Diffstat (limited to 'intl')
-rw-r--r--intl/dcigettext.c5
-rw-r--r--intl/finddomain.c5
-rw-r--r--intl/localealias.c21
3 files changed, 8 insertions, 23 deletions
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 42d39a1771..80c71efbc4 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -1124,8 +1124,7 @@ mempcpy (dest, src, n)
 #ifdef _LIBC
 /* If we want to free all resources we have to do some work at
    program's end.  */
-static void __attribute__ ((unused))
-free_mem (void)
+libc_freeres_fn (free_mem)
 {
   void *old;
 
@@ -1155,6 +1154,4 @@ free_mem (void)
       free (old);
     }
 }
-
-text_set_element (__libc_subfreeres, free_mem);
 #endif
diff --git a/intl/finddomain.c b/intl/finddomain.c
index e0e11f0b7e..1031e4d5b1 100644
--- a/intl/finddomain.c
+++ b/intl/finddomain.c
@@ -168,8 +168,7 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
 
 
 #ifdef _LIBC
-static void __attribute__ ((unused))
-free_mem (void)
+libc_freeres_fn (free_mem)
 {
   struct loaded_l10nfile *runp = _nl_loaded_domains;
 
@@ -183,6 +182,4 @@ free_mem (void)
       free (here);
     }
 }
-
-text_set_element (__libc_subfreeres, free_mem);
 #endif
diff --git a/intl/localealias.c b/intl/localealias.c
index 0afe98134b..f5d4e57dc3 100644
--- a/intl/localealias.c
+++ b/intl/localealias.c
@@ -117,10 +117,14 @@ struct alias_map
 };
 
 
-static char *string_space;
+#ifndef _LIBC
+# define libc_freeres_ptr(decl) decl
+#endif
+
+libc_freeres_ptr (static char *string_space);
 static size_t string_space_act;
 static size_t string_space_max;
-static struct alias_map *map;
+libc_freeres_ptr (static struct alias_map *map);
 static size_t nmap;
 static size_t maxmap;
 
@@ -371,19 +375,6 @@ extend_alias_table ()
 }
 
 
-#ifdef _LIBC
-static void __attribute__ ((unused))
-free_mem (void)
-{
-  if (string_space != NULL)
-    free (string_space);
-  if (map != NULL)
-    free (map);
-}
-text_set_element (__libc_subfreeres, free_mem);
-#endif
-
-
 static int
 alias_compare (map1, map2)
      const struct alias_map *map1;