[Webkit-unassigned] [Bug 46695] Invalid pointer access & incomplete memcmp in setUpIterator
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 24 08:39:35 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=46695
--- Comment #29 from chris reiss <christopher.reiss at nokia.com> 2011-02-24 08:39:34 PST ---
This is an optimization.
When we're rendering lots of text in RenderBlock::findNextLineBreak( ), we make many calls to isBreakable( ), which in turns creates a lot of TextBreakIterators. This got very expensive in
the Qt port, for a <div> with lots of text, 0.7 seconds were spent in setUpIterator. See comment 16 .
Within the RenderBlock::findNextLine( ) loop, we're passing the same string repeatedly to isBreakable( ). So we'd like to reuse the TextBreakIterator from last time. We'd like setupTextIterator to recognize that the string
hasn't changed.
The wrinkle is that a raw UChar* is passed to setUpIterator. The pointer may not have changed since last time, but there's an outside chance that the memory has been deleted and reallocated (isBreakable() has lots of call sites.)
So setupTextIterator( ) is never sure that it can reuse the last iterator.
This patch gives the call site the option to pass a RefPtr string to isBreakable( ). If the parameter is present, setupTextIterator will use it to avoid recreating iterators on the same string.
So I needed to add that parameter to code outside the Qt port. The hope is - it's essentially a NOOP for other ports so they wouldn't mind too much,
and perhaps even find it useful at some point.
--
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