From 2c70245061dd5c0aaabc2122db4acc348c6f247d Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Sun, 9 Mar 2014 22:34:52 -0700 Subject: [PATCH] Ticket #47734 - Change made in resolving ticket #346 fails on Debian SPARC64 Description: The following change is not generic beyond x86 and x86_64 architecture. Putting the change into "#if (defined(CPU_x86) || defined(CPU_x86_64))". commit c0151f78509c35250095da6e2785842337963008 Trac Ticket #346 - Slow ldapmodify operation time for large quantities of multi-valued attribute values 3) In slapi_has8thBit, instead of checking the 8th bit one byte by one byte, check 4 bytes at one time. --- ldap/servers/slapd/utf8compare.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ldap/servers/slapd/utf8compare.c b/ldap/servers/slapd/utf8compare.c index e336ccb..d2dd83e 100644 --- a/ldap/servers/slapd/utf8compare.c +++ b/ldap/servers/slapd/utf8compare.c @@ -60,6 +60,7 @@ typedef struct sUpperLowerTbl { int slapi_has8thBit(unsigned char *s) { +#if (defined(CPU_x86) || defined(CPU_x86_64)) #define MY8THBITWIDTH 4 /* sizeof(PRUint32) */ #define MY8THBITFILTER 0x80808080 unsigned char *p, *stail, *ltail; @@ -73,14 +74,20 @@ slapi_has8thBit(unsigned char *s) return 1; } } - for (; p < ltail; p++) { +#undef MY8THBITWIDTH +#undef MY8THBITFILTER + for (; p < ltail; p++) +#else + unsigned char *p, *tail; + tail = s + strlen((char *)s); + for (p = s; p < tail; p++) +#endif + { if (0x80 & *p) { return 1; } } return 0; -#undef MY8THBITWIDTH -#undef MY8THBITFILTER } /* -- 1.8.1.4