summaryrefslogtreecommitdiff
path: root/indra/llui/llviewmodel.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-05-13 10:02:26 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-05-13 10:02:26 -0400
commit7b9708a2e3aede6faef04bd546c497dc68264f58 (patch)
treec49b3779d7a1f2e94fa1d33396c882e3351a4797 /indra/llui/llviewmodel.cpp
parentd0eb9658f2698b9c200991e84c1a60be48788e2c (diff)
parentd0ef02c23a7a37c8c9bfe3a86bae88bb811fc9fe (diff)
sunshine-external merge WIP
Diffstat (limited to 'indra/llui/llviewmodel.cpp')
-rwxr-xr-xindra/llui/llviewmodel.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp
index a9f8acc440..282addf692 100755
--- a/indra/llui/llviewmodel.cpp
+++ b/indra/llui/llviewmodel.cpp
@@ -37,13 +37,15 @@
///
LLViewModel::LLViewModel()
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
}
/// Instantiate an LLViewModel with an existing data value
LLViewModel::LLViewModel(const LLSD& value)
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
setValue(value);
}
@@ -79,8 +81,16 @@ LLTextViewModel::LLTextViewModel(const LLSD& value)
/// Update the stored value
void LLTextViewModel::setValue(const LLSD& value)
{
+ // approximate LLSD storage usage
+ disclaimMem(mDisplay.size());
LLViewModel::setValue(value);
+ disclaimMem(mDisplay);
mDisplay = utf8str_to_wstring(value.asString());
+
+ claimMem(mDisplay);
+ // approximate LLSD storage usage
+ claimMem(mDisplay.size());
+
// mDisplay and mValue agree
mUpdateFromDisplay = false;
}
@@ -91,7 +101,11 @@ void LLTextViewModel::setDisplay(const LLWString& value)
// and do the utf8str_to_wstring() to get the corresponding mDisplay
// value. But a text editor might want to edit the display string
// directly, then convert back to UTF8 on commit.
+ disclaimMem(mDisplay.size());
+ disclaimMem(mDisplay);
mDisplay = value;
+ claimMem(mDisplay);
+ claimMem(mDisplay.size());
mDirty = true;
// Don't immediately convert to UTF8 -- do it lazily -- we expect many
// more setDisplay() calls than getValue() calls. Just flag that it needs