summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-24 15:18:05 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-24 15:18:05 (GMT)
commit723dfce0f2af6d93d2c1b50f5e44ad3cf63e058c (patch)
treef8e1c8693aceea8f1d2fc03d9ad1555b0a441a27 /src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
parentf90d8f3fe7e39a20b93a2ddfe0704bc48f3bd5f9 (diff)
parentdab9d7c67ed2eda150c8da9e41db75f7eeeecd0d (diff)
downloadQt-723dfce0f2af6d93d2c1b50f5e44ad3cf63e058c.zip
Qt-723dfce0f2af6d93d2c1b50f5e44ad3cf63e058c.tar.gz
Qt-723dfce0f2af6d93d2c1b50f5e44ad3cf63e058c.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/kernel/qapplication_x11.cpp
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
index 0eb46da..118751e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp
@@ -63,7 +63,7 @@ extern const double NaN;
extern const double Inf;
// This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings.
-static const int minLengthToShare = 30;
+static const int minLengthToShare = 10;
static inline size_t overflowIndicator() { return std::numeric_limits<size_t>::max(); }
static inline size_t maxUChars() { return std::numeric_limits<size_t>::max() / sizeof(UChar); }
@@ -243,6 +243,15 @@ PassRefPtr<UString::Rep> UString::Rep::create(UChar* string, int length, PassRef
return rep;
}
+UString::SharedUChar* UString::Rep::sharedBuffer()
+{
+ UString::BaseString* base = baseString();
+ if (len < minLengthToShare)
+ return 0;
+
+ return base->sharedBuffer();
+}
+
void UString::Rep::destroy()
{
checkConsistency();
@@ -385,10 +394,6 @@ void UString::Rep::checkConsistency() const
UString::SharedUChar* UString::BaseString::sharedBuffer()
{
-
- if (len < minLengthToShare)
- return 0;
-
if (!m_sharedBuffer)
setSharedBuffer(SharedUChar::create(new OwnFastMallocPtr<UChar>(buf)));
return m_sharedBuffer;