aboutsummaryrefslogtreecommitdiff
path: root/locale/loadarchive.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-10 23:55:20 +0000
committerRoland McGrath <roland@gnu.org>2002-08-10 23:55:20 +0000
commita89a3dab8050c1dbf0c125d44d45ff67b43703cb (patch)
tree297330f1534ba93dd23c4eaab2b0b37b3e859099 /locale/loadarchive.c
parent0752d00848022cdb532a4b548997811e34530af3 (diff)
downloadglibc-a89a3dab8050c1dbf0c125d44d45ff67b43703cb.zip
glibc-a89a3dab8050c1dbf0c125d44d45ff67b43703cb.tar.gz
glibc-a89a3dab8050c1dbf0c125d44d45ff67b43703cb.tar.bz2
2002-08-10 Roland McGrath <roland@redhat.com>
* locale/loadarchive.c (_nl_archive_subfreeres): New function. * locale/localeinfo.h: Declare it. * locale/setlocale.c (free_mem): Don't call _nl_unload_locale on the current locale if it's not in the file list. Call _nl_archive_subfreeres. * include/wctype.h (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, towlower, towupper): Add prototypes here too. Add libc_hidden_proto. * wctype/wcfuncs.c (iswalpha, iswdigit, iswlower, iswspace, iswxdigit, towlower, towupper): Add libc_hidden_weak.
Diffstat (limited to 'locale/loadarchive.c')
-rw-r--r--locale/loadarchive.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index 08e5f94..a9b5386 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -445,3 +445,44 @@ _nl_load_locale_from_archive (int category, const char **namep)
*namep = lia->name;
return lia->data[category];
}
+
+void
+_nl_archive_subfreeres (void)
+{
+ struct locale_in_archive *lia;
+ struct archmapped *am;
+
+ /* Toss out our cached locales. */
+ lia = archloaded;
+ while (lia != NULL)
+ {
+ int category;
+ struct locale_in_archive *dead = lia;
+ lia = lia->next;
+
+ for (category = 0; category < __LC_LAST; ++category)
+ if (category != LC_ALL)
+ /* _nl_unload_locale just does this free for the archive case. */
+ free (dead->data[category]);
+ free (dead);
+ }
+ archloaded = NULL;
+
+ if (archmapped != NULL)
+ {
+ /* Now toss all the mapping windows, which we know nothing is using any
+ more because we just tossed all the locales that point into them. */
+
+ assert (archmapped == &headmap);
+ archmapped = NULL;
+ (void) munmap (headmap.ptr, headmap.len);
+ am = headmap.next;
+ while (am != NULL)
+ {
+ struct archmapped *dead = am;
+ am = am->next;
+ (void) munmap (dead->ptr, dead->len);
+ free (dead);
+ }
+ }
+}