[Webkit-unassigned] [Bug 48625] [GTK] Optimize foldCase, toLower and toUpper methods in glib unicode backend

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 29 05:37:41 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48625


Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #72318|                            |review?, commit-queue?
               Flag|                            |




--- Comment #1 from Carlos Garcia Campos <cgarcia at igalia.com>  2010-10-29 05:37:41 PST ---
Created an attachment (id=72318)
 --> (https://bugs.webkit.org/attachment.cgi?id=72318&action=review)
Patch

GLib methods use UTF-8 strings, so we have to convert from UTF-16 to UTF-8 to perform the case operations and then convert back the result to UTF-16. GLib conversion methods return a new allocated string, so we have to memcpy the result into the destination buffer too. Using our own methods to convert between UTF-8 and UTF-16 from wtf/unicode/UTF8.h we don't need such memcpy, since they take an already allocated buffer rather than returning a new one. There's another optimization for the case when the destination buffer is not large enough. In that case, methods should return the expected destination buffer size and are called again with a new buffer. We can avoid the conversion to UTF-16 by pre-calculating the required size for the destination buffer.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list