Changeset 44325 in webkit for trunk/JavaScriptCore/runtime/UString.cpp
- Timestamp:
- Jun 1, 2009, 11:41:20 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/UString.cpp
r44224 r44325 63 63 extern const double Inf; 64 64 65 // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. 66 static const int minLengthToShare = 30; 67 65 68 static inline size_t overflowIndicator() { return std::numeric_limits<size_t>::max(); } 66 69 static inline size_t maxUChars() { return std::numeric_limits<size_t>::max() / sizeof(UChar); } … … 233 236 } 234 237 235 PassRefPtr<UString::Rep> UString::Rep:: share(UChar* string, int length, PassRefPtr<UString::SharedUChar> sharedBuffer)238 PassRefPtr<UString::Rep> UString::Rep::create(UChar* string, int length, PassRefPtr<UString::SharedUChar> sharedBuffer) 236 239 { 237 240 PassRefPtr<UString::Rep> rep = create(string, length); … … 383 386 UString::SharedUChar* UString::BaseString::sharedBuffer() 384 387 { 385 // Don't share empty, null and 1 character strings from SmallStrings. 386 if (len < = 1)388 389 if (len < minLengthToShare) 387 390 return 0; 388 391
Note:
See TracChangeset
for help on using the changeset viewer.