瀏覽代碼

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.

https://fedorahosted.org/389/ticket/47734

Reviewed by [email protected] (Thank you, Rich!!)
Noriko Hosoi 11 年之前
父節點
當前提交
1e00913312
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. 10 3
      ldap/servers/slapd/utf8compare.c

+ 10 - 3
ldap/servers/slapd/utf8compare.c

@@ -60,6 +60,7 @@ typedef struct sUpperLowerTbl {
 int
 int
 slapi_has8thBit(unsigned char *s)
 slapi_has8thBit(unsigned char *s)
 {
 {
+#if (defined(CPU_x86) || defined(CPU_x86_64))
 #define MY8THBITWIDTH 4 /* sizeof(PRUint32) */
 #define MY8THBITWIDTH 4 /* sizeof(PRUint32) */
 #define MY8THBITFILTER 0x80808080
 #define MY8THBITFILTER 0x80808080
     unsigned char *p, *stail, *ltail;
     unsigned char *p, *stail, *ltail;
@@ -73,14 +74,20 @@ slapi_has8thBit(unsigned char *s)
              return 1;
              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) {
         if (0x80 & *p) {
              return 1;
              return 1;
         }
         }
     }
     }
     return 0;
     return 0;
-#undef MY8THBITWIDTH
-#undef MY8THBITFILTER
 }
 }
 
 
 /*
 /*