From 1f56e57008f5a50c9e75fc0b4512c483ac359a52 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Dec 2012 00:58:26 -0800 Subject: SH-3468 WIP add memory tracking base class created memory tracking trace type instrumented a few classes with memory tracking --- indra/llui/lltextbase.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 3815eec447..31d67a9e08 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -561,7 +561,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - mMisspellRanges.clear(); + memDisclaim(mMisspellRanges).clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -632,6 +632,7 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; + memClaim(mMisspellRanges); } } @@ -890,10 +891,12 @@ void LLTextBase::createDefaultSegment() // ensures that there is always at least one segment if (mSegments.empty()) { + memDisclaim(mSegments); LLStyleConstSP sp(new LLStyle(getDefaultStyleParams())); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); + memClaim(mSegments); } } @@ -904,6 +907,8 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } + memDisclaim(mSegments); + segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -976,6 +981,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); + memClaim(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1271,8 +1277,11 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place + memDisclaim(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); + memClaim(mSuggestionList); + setCursorPos(it->first + (S32)suggestion.length()); break; @@ -1334,7 +1343,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - mMisspellRanges.clear(); + memDisclaim(mMisspellRanges).clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1593,7 +1602,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - mSegments.clear(); + memDisclaim(mSegments).clear(); createDefaultSegment(); } @@ -3057,7 +3066,9 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) llwarns << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << llendl; return; } + memDisclaim(mTooltip); mTooltip = tooltip; + memClaim(mTooltip); } bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const -- cgit v1.2.3 From cbff0e7ab8afeebb6ddab854d35ea12ef9a9930a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 4 Jan 2013 13:48:35 -0800 Subject: SH-3468 WIP add memory tracking base class attempted fix for gcc compile errors can't use typeid() on a class that doesn't have a method defined in a translation unit fix is to force classes deriving from LLMemTrackable to use their own static member named sMemStat --- indra/llui/lltextbase.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 31d67a9e08..74e966560e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -47,6 +47,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; +LLTrace::MemStat LLTextSegment::sMemStat("LLTextSegment"); + LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), -- cgit v1.2.3 From f07b9c2c69f1f6882dcf249aacf33cdfacf878ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Mar 2013 11:08:25 -0800 Subject: renamed LLTrace stat gathering classes/methods to make the structure of LLTrace clearer Count becomes CountStatHandle Count.sum becomes sum(Count, value), etc. --- indra/llui/lltextbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 74e966560e..680b6ed16d 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -47,7 +47,7 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; -LLTrace::MemStat LLTextSegment::sMemStat("LLTextSegment"); +LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), -- cgit v1.2.3 From 41b4374760dd060a7f51a4a837851d5a03b7242a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 10 May 2013 17:57:12 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics renamed LLView::handleVisibilityChange to onVisibilityChange to reflect standard naming conventions for handlers vs. reactors --- indra/llui/lltextbase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 680b6ed16d..025b3c4165 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1222,13 +1222,13 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c) } //virtual -void LLTextBase::handleVisibilityChange( BOOL new_visibility ) +void LLTextBase::onVisibilityChange( BOOL new_visibility ) { if(!new_visibility && mPopupMenu) { mPopupMenu->hide(); } - LLUICtrl::handleVisibilityChange(new_visibility); + LLUICtrl::onVisibilityChange(new_visibility); } //virtual -- cgit v1.2.3 From 04bdc8ba83c297945dd60489c241b88adf892ff4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 17:04:01 -0700 Subject: SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0% also, removed LLTrace::init and cleanup removed derived class implementation of memory stat for LLMemTrackable is automatic now --- indra/llui/lltextbase.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7243931dbb..9845941778 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,8 +48,6 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); - LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), -- cgit v1.2.3 From 8208a40412fac35593d4b8b13f43c6be5e4d6990 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Jul 2013 18:50:51 -0700 Subject: BUILDFIX: reverted changes that attempted to automate mem track stat definition as they don't work on gcc/clang --- indra/llui/lltextbase.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9845941778..7243931dbb 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,6 +48,8 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. +LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); + LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/llui/lltextbase.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7243931dbb..94cf93bd3c 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -687,7 +687,7 @@ void LLTextBase::drawText() seg_iter++; if (seg_iter == mSegments.end()) { - llwarns << "Ran off the segmentation end!" << llendl; + LL_WARNS() << "Ran off the segmentation end!" << LL_ENDL; return; } @@ -1487,7 +1487,7 @@ void LLTextBase::reflow() // use an even number of iterations to avoid user visible oscillation of the layout if(++reflow_count > 2) { - lldebugs << "Breaking out of reflow due to possible infinite loop in " << getName() << llendl; + LL_DEBUGS() << "Breaking out of reflow due to possible infinite loop in " << getName() << LL_ENDL; break; } @@ -2120,7 +2120,7 @@ void LLTextBase::setFont(const LLFontGL* font) void LLTextBase::needsReflow(S32 index) { - lldebugs << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << llendl; + LL_DEBUGS() << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << LL_ENDL; mReflowIndex = llmin(mReflowIndex, index); } @@ -3162,7 +3162,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) // we cannot replace a keyword tooltip that's loaded from a file if (mToken) { - llwarns << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << llendl; + LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } memDisclaim(mTooltip); @@ -3220,14 +3220,14 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin if(getLength() < segment_offset + mStart) { - llinfos << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" - << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl; + LL_INFOS() << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t" + << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << LL_ENDL; } if(offsetString.length() + 1 < max_chars) { - llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " - << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl; + LL_INFOS() << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetString.length() << " getLength() : " + << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << LL_ENDL; } S32 num_chars = mStyle->getFont()->maxDrawableChars(offsetString.c_str(), @@ -3257,13 +3257,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin void LLNormalTextSegment::dump() const { - llinfos << "Segment [" << + LL_INFOS() << "Segment [" << // mColor.mV[VX] << ", " << // mColor.mV[VY] << ", " << // mColor.mV[VZ] << "]\t[" << mStart << ", " << getEnd() << "]" << - llendl; + LL_ENDL; } /*virtual*/ -- cgit v1.2.3 From cbe397ad13665c7bc993e10d8fe1e4a876253378 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 5 Sep 2013 14:04:13 -0700 Subject: changed fast timer over to using macro another attempt to move mem stat into base class --- indra/llui/lltextbase.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 94cf93bd3c..3f4dcb7579 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,7 +48,7 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); +//LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), @@ -1442,10 +1442,10 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); +static LLTrace::TimeBlock FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow() { - LLFastTimer ft(FTM_TEXT_REFLOW); + LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW); updateSegments(); @@ -1784,10 +1784,10 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLTrace::TimeBlock FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { - LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS); + LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); createDefaultSegment(); } @@ -1990,7 +1990,7 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name) } } -static LLFastTimer::DeclareTimer FTM_PARSE_HTML("Parse HTML"); +static LLTrace::TimeBlock FTM_PARSE_HTML("Parse HTML"); void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { @@ -2000,7 +2000,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para S32 part = (S32)LLTextParser::WHOLE; if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358). { - LLFastTimer _(FTM_PARSE_HTML); + LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML); S32 start=0,end=0; LLUrlMatch match; std::string text = new_text; @@ -2067,11 +2067,11 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para } } -static LLFastTimer::DeclareTimer FTM_APPEND_TEXT("Append Text"); +static LLTrace::TimeBlock FTM_APPEND_TEXT("Append Text"); void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { - LLFastTimer _(FTM_APPEND_TEXT); + LL_RECORD_BLOCK_TIME(FTM_APPEND_TEXT); if (new_text.empty()) return; -- cgit v1.2.3 From 053d97db1b283ca2548dc1f64756ddfc5166158f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 25 Sep 2013 19:12:35 -0700 Subject: better memory usage for LLTrace (tighter packing of recording arrays) removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway) improved MemTrackable API, better separation of shadow and footprint added memory usage stats to floater_stats.xml --- indra/llui/lltextbase.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 975f9df382..5c221edea7 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -48,8 +48,6 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 CURSOR_THICKNESS = 2; const F32 TRIPLE_CLICK_INTERVAL = 0.3f; // delay between double and triple click. -//LLTrace::MemStatHandle LLTextSegment::sMemStat("LLTextSegment"); - LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num) : mDocIndexStart(index_start), mDocIndexEnd(index_end), @@ -578,7 +576,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - memDisclaim(mMisspellRanges).clear(); + disclaimMem(mMisspellRanges).clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -654,7 +652,7 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; - memClaim(mMisspellRanges); + claimMem(mMisspellRanges); } } else @@ -924,11 +922,11 @@ void LLTextBase::createDefaultSegment() if (mSegments.empty()) { LLStyleConstSP sp(new LLStyle(getStyleParams())); - memDisclaim(mSegments); + disclaimMem(mSegments); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); - memClaim(mSegments); + claimMem(mSegments); } } @@ -939,7 +937,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } - memDisclaim(mSegments); + disclaimMem(mSegments); segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -1013,7 +1011,7 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); - memClaim(mSegments); + claimMem(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1324,10 +1322,10 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place - memDisclaim(mSuggestionList); + disclaimMem(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); - memClaim(mSuggestionList); + claimMem(mSuggestionList); setCursorPos(it->first + (S32)suggestion.length()); @@ -1390,7 +1388,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - memDisclaim(mMisspellRanges).clear(); + disclaimMem(mMisspellRanges).clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1668,7 +1666,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - memDisclaim(mSegments).clear(); + disclaimMem(mSegments).clear(); createDefaultSegment(); } @@ -3212,9 +3210,9 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } - memDisclaim(mTooltip); + disclaimMem(mTooltip); mTooltip = tooltip; - memClaim(mTooltip); + claimMem(mTooltip); } bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const -- cgit v1.2.3 From 12f0f8cb72f789e21b01b45063dcc5f1f5292087 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 1 Oct 2013 13:46:43 -0700 Subject: changed over to manual naming of MemTrackable stats changed claimMem and disclaimMem behavior to not pass through argument added more mem tracking stats to floater_stats --- indra/llui/lltextbase.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5c221edea7..730c3b2ada 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -576,7 +576,7 @@ void LLTextBase::drawText() if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) ) { const LLWString& wstrText = getWText(); - disclaimMem(mMisspellRanges).clear(); + mMisspellRanges.clear(); segment_set_t::const_iterator seg_it = getSegIterContaining(start); while (mSegments.end() != seg_it) @@ -652,7 +652,6 @@ void LLTextBase::drawText() mSpellCheckStart = start; mSpellCheckEnd = end; - claimMem(mMisspellRanges); } } else @@ -922,11 +921,9 @@ void LLTextBase::createDefaultSegment() if (mSegments.empty()) { LLStyleConstSP sp(new LLStyle(getStyleParams())); - disclaimMem(mSegments); LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); - claimMem(mSegments); } } @@ -937,8 +934,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) return; } - disclaimMem(mSegments); - segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart()); S32 reflow_start_index = 0; @@ -1011,7 +1006,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert) // layout potentially changed needsReflow(reflow_start_index); - claimMem(mSegments); } BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1322,10 +1316,8 @@ void LLTextBase::replaceWithSuggestion(U32 index) removeStringNoUndo(it->first, it->second - it->first); // Insert the suggestion in its place - disclaimMem(mSuggestionList); LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]); insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index])); - claimMem(mSuggestionList); setCursorPos(it->first + (S32)suggestion.length()); @@ -1388,7 +1380,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const void LLTextBase::onSpellCheckSettingsChange() { // Recheck the spelling on every change - disclaimMem(mMisspellRanges).clear(); + mMisspellRanges.clear(); mSpellCheckStart = mSpellCheckEnd = -1; } @@ -1666,7 +1658,7 @@ LLRect LLTextBase::getTextBoundingRect() void LLTextBase::clearSegments() { - disclaimMem(mSegments).clear(); + mSegments.clear(); createDefaultSegment(); } @@ -3210,9 +3202,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL; return; } - disclaimMem(mTooltip); mTooltip = tooltip; - claimMem(mTooltip); } bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const -- cgit v1.2.3 From 17df8988fec3f2ba991ca9e34ff8148253a2fc04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 7 Oct 2013 13:38:03 -0700 Subject: renamed TraceType to StatType added more MemTrackable types optimized memory usage of LLTrace some more --- indra/llui/lltextbase.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 730c3b2ada..00382125a8 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1871,7 +1871,6 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index) // when there are no segments, we return the end iterator, which must be checked by caller if (mSegments.size() <= 1) { return mSegments.begin(); } - //FIXME: avoid operator new somehow (without running into refcount problems) index_segment->setStart(index); index_segment->setEnd(index); segment_set_t::iterator it = mSegments.upper_bound(index_segment); -- cgit v1.2.3 From 697d2e720ba75e142a4d56ae8794bab8d7698dad Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 15 Oct 2013 20:24:42 -0700 Subject: renamed TimeBlock to BlockTimerStatHandle --- indra/llui/lltextbase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1c64751fbc..f08aeecc99 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1437,7 +1437,7 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLTrace::TimeBlock FTM_TEXT_REFLOW ("Text Reflow"); +static LLTrace::BlockTimerStatHandle FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow() { LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW); @@ -1779,7 +1779,7 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLTrace::TimeBlock FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLTrace::BlockTimerStatHandle FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS); @@ -2020,7 +2020,7 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name) } } -static LLTrace::TimeBlock FTM_PARSE_HTML("Parse HTML"); +static LLTrace::BlockTimerStatHandle FTM_PARSE_HTML("Parse HTML"); void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) { @@ -2097,7 +2097,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para } } -static LLTrace::TimeBlock FTM_APPEND_TEXT("Append Text"); +static LLTrace::BlockTimerStatHandle FTM_APPEND_TEXT("Append Text"); void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { -- cgit v1.2.3