Changeset 19843 in webkit
- Timestamp:
- Feb 24, 2007 6:14:54 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r19840 r19843 1 2007-02-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Layout tests for BidiRun leaks. 6 7 * fast/leaks/001-expected.txt: Added. 8 * fast/leaks/001.html: Added. 9 * fast/leaks/002-expected.txt: Added. 10 * fast/leaks/002.html: Added. 11 1 12 2007-02-24 Alexey Proskuryakov <ap@webkit.org> 2 13 -
trunk/WebCore/ChangeLog
r19842 r19843 1 2007-02-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Fixed <rdar://problem/4987649> leaks in BidiRun::operator new seen while 6 running WebKit unit tests 7 8 In bidi.cpp, some functions allocate BidiRuns and put them in a global data 9 structure, while others uses the BidiRuns in the global data structure. 10 The caller is responsible for knowing which functions may allocate runs 11 and which may use them, and calling deleteBidiRuns() at the appropriate time. 12 13 The fix is to add some calls to deleteBidiRuns() where they were missing. 14 15 I also added a BidiRun counter because these two leaks were introduced by 16 our two bidi.cpp experts, so the odds that leaks will creep in again 17 in the future seem pretty high. 18 19 * rendering/bidi.cpp: 20 (WebCore::RenderBlock::bidiReorderCharacters): Added missing call to 21 deleteBidiRuns(). 22 (WebCore::BidiRunCounter::~BidiRunCounter): 23 (WebCore::BidiRun::operator delete): 24 (WebCore::RenderBlock::layoutInlineChildren): Added missing call to 25 deleteBidiRuns(). Moved call to deleteBidiRuns() to same scope as call to 26 bidiReorderLine(), to emphasize that they go together like new/delete. 27 In theory, the old code was just as good, but I didn't want to rely on 28 theory. 29 1 30 2007-02-24 David Harrison <harrison@apple.com> 2 31 -
trunk/WebCore/rendering/bidi.cpp
r19717 r19843 30 30 #include "FrameView.h" 31 31 #include "InlineTextBox.h" 32 #include "Logging.h" 32 33 #include "RenderArena.h" 33 34 #include "RenderLayer.h" … … 112 113 static void embed(Direction, BidiState&); 113 114 static void appendRun(BidiState&); 115 static void deleteBidiRuns(RenderArena*); 114 116 115 117 void RenderBlock::bidiReorderCharacters(Document* document, RenderStyle* style, CharacterBuffer& characterBuffer) … … 169 171 } 170 172 171 // Tear down temporary RenderBlock and RenderText173 // Tear down temporary RenderBlock, RenderText, and BidiRuns 172 174 block->removeChild(text); 173 175 text->destroy(); 174 176 block->destroy(); 177 deleteBidiRuns(document->renderArena()); 175 178 } 176 179 … … 213 216 214 217 #ifndef NDEBUG 218 WTFLogChannel LogWebCoreBidiRunLeaks = { 0x00000000, "", WTFLogChannelOn }; 219 220 struct BidiRunCounter { 221 static int count; 222 ~BidiRunCounter() 223 { 224 if (count) 225 LOG(WebCoreBidiRunLeaks, "LEAK: %d BidiRun\n", count); 226 } 227 }; 228 int BidiRunCounter::count = 0; 229 static BidiRunCounter bidiRunCounter; 230 215 231 static bool inBidiRunDestroy; 216 232 #endif … … 232 248 void* BidiRun::operator new(size_t sz, RenderArena* renderArena) throw() 233 249 { 250 #ifndef NDEBUG 251 ++BidiRunCounter::count; 252 #endif 234 253 return renderArena->allocate(sz); 235 254 } … … 237 256 void BidiRun::operator delete(void* ptr, size_t sz) 238 257 { 258 #ifndef NDEBUG 259 --BidiRunCounter::count; 260 #endif 239 261 assert(inBidiRunDestroy); 240 262 … … 1690 1712 } 1691 1713 end = findNextLineBreak(start, bidi); 1692 if (start.atEnd()) 1714 if (start.atEnd()) { 1715 deleteBidiRuns(renderArena()); 1693 1716 break; 1717 } 1694 1718 if (!isLineEmpty) { 1695 1719 bidiReorderLine(start, end, bidi); … … 1723 1747 lineBox->addHighlightOverflow(); 1724 1748 #endif 1725 1726 deleteBidiRuns(renderArena());1727 1749 } 1728 1750 } 1751 1752 deleteBidiRuns(renderArena()); 1729 1753 1730 1754 if (end == start) { -
trunk/WebKitTools/ChangeLog
r19839 r19843 1 2007-02-24 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Darin Adler. 4 5 * Scripts/run-webkit-tests: Stop ignoring BidiRun leaks, now that they're 6 fixed. 7 1 8 2007-02-24 Krzysztof Kowalczyk <kkowalczyk@gmail.com> 2 9 -
trunk/WebKitTools/Scripts/run-webkit-tests
r19798 r19843 853 853 "NSURLCache cachedResponseForRequest", # leak in CFURL cache, Radar 4768430 854 854 "CGImageSourceGetPropertiesAtIndex", # leak apparently in CG, Radar 4628809 855 "BidiRun::operator new", # leak in WebCore, Radar 4987649856 855 "gldGetString" # leak apparently in OpenGL, Radar 5013699 857 856 );
Note: See TracChangeset
for help on using the changeset viewer.