diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSString.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSString.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp index cfa7d03b4..e84ce3620 100644 --- a/Source/JavaScriptCore/runtime/JSString.cpp +++ b/Source/JavaScriptCore/runtime/JSString.cpp @@ -65,9 +65,10 @@ void JSString::resolveRope(ExecState* exec) const if (is8Bit()) { LChar* buffer; - if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) + if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { + Heap::heap(this)->reportExtraMemoryCost(newImpl->cost()); m_value = newImpl.release(); - else { + } else { outOfMemory(exec); return; } @@ -92,9 +93,10 @@ void JSString::resolveRope(ExecState* exec) const } UChar* buffer; - if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) + if (RefPtr<StringImpl> newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) { + Heap::heap(this)->reportExtraMemoryCost(newImpl->cost()); m_value = newImpl.release(); - else { + } else { outOfMemory(exec); return; } |