Ignore:
Timestamp:
Feb 21, 2010, 10:50:44 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Make UString::m_data be const, and make the UChar owned/ref-counted by CrossThreadRefCounted be const too.

Reviewed by Oliver Hunt.

  • runtime/UStringImpl.cpp:

(JSC::UStringImpl::baseSharedBuffer):
(JSC::UStringImpl::~UStringImpl):

  • runtime/UStringImpl.h:

(JSC::UStringImpl::create):
(JSC::UStringImpl::data):
(JSC::UStringImpl::UStringImpl):

  • wtf/OwnFastMallocPtr.h:

(WTF::OwnFastMallocPtr::~OwnFastMallocPtr):

WebCore: Make the UChar owned/ref-counted by StringImpl::CrossThreadRefCounted be const.

Reviewed by Oliver Hunt.

  • platform/text/StringImpl.cpp:

(WebCore::StringImpl::sharedBuffer):

  • platform/text/StringImpl.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/UStringImpl.cpp

    r55035 r55069  
    8080    if (bufferOwnership() != BufferShared) {
    8181        m_refCountAndFlags = (m_refCountAndFlags & ~s_refCountMaskBufferOwnership) | BufferShared;
    82         m_bufferShared = SharedUChar::create(new OwnFastMallocPtr<UChar>(m_data)).releaseRef();
     82        m_bufferShared = SharedUChar::create(new SharableUChar(m_data)).releaseRef();
    8383    }
    8484
     
    109109    if (bufferOwnership() != BufferInternal) {
    110110        if (bufferOwnership() == BufferOwned)
    111             fastFree(m_data);
     111            fastFree(const_cast<UChar*>(m_data));
    112112        else if (bufferOwnership() == BufferSubstring)
    113113            m_bufferSubstring->deref();
Note: See TracChangeset for help on using the changeset viewer.