summaryrefslogtreecommitdiff
path: root/ctype
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-10-15 16:27:08 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-15 16:27:08 -0400
commitfd5bdc0924e0cfd1688b632068c1b26f3b0c88da (patch)
treeaac5e56322b05ae60be779de324b90087fb99dc4 /ctype
parent2d1f3a4db65d2731a695dee6b973accea8b9adc0 (diff)
Optimize access to isXYZ and toXYZ tables
The functions to get the pointers can now depend on the TLS variable be initialized.
Diffstat (limited to 'ctype')
-rw-r--r--ctype/Versions3
-rw-r--r--ctype/ctype-info.c15
2 files changed, 17 insertions, 1 deletions
diff --git a/ctype/Versions b/ctype/Versions
index 8cf0338b39..84f1e2c7cb 100644
--- a/ctype/Versions
+++ b/ctype/Versions
@@ -21,4 +21,7 @@ libc {
# functions used by optimized macros in ctype.h
__ctype_b_loc; __ctype_tolower_loc; __ctype_toupper_loc;
}
+ GLIBC_PRIVATE {
+ __ctype_init;
+ }
}
diff --git a/ctype/ctype-info.c b/ctype/ctype-info.c
index 03b67d179f..b64e7439a8 100644
--- a/ctype/ctype-info.c
+++ b/ctype/ctype-info.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 2008
+/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 2008, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -26,6 +26,19 @@ __libc_tsd_define (, const int32_t *, CTYPE_TOLOWER)
__libc_tsd_define (, const int32_t *, CTYPE_TOUPPER)
+void
+__ctype_init (void)
+{
+ const uint16_t **bp = __libc_tsd_address (const uint16_t *, CTYPE_B);
+ *bp = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
+ const int32_t **up = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+ *up = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
+ const int32_t **lp = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+ *lp = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
+}
+libc_hidden_def (__ctype_init)
+
+
#include <shlib-compat.h>
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)