[webkit-changes] cvs commit: WebCore/kwq DOM-CSS.mm DOM.mm DOMEvents.mm DOMHTML.mm DOMInternal.mm DOMViews.mm KWQAccObject.mm KWQAccObjectCache.mm KWQArrayImpl.h KWQArrayImpl.mm KWQButton.mm KWQCString.mm KWQClipboard.h KWQClipboard.mm KWQColor.mm KWQComboBox.mm KWQEditCommand.mm KWQExceptions.h KWQFileButton.mm KWQFontFamily.h KWQFormData.mm KWQKHTMLPart.h KWQKHTMLPart.mm KWQKPartsBrowserInterface.mm KWQKURL.mm KWQListBox.mm KWQListImpl.mm KWQLogging.h KWQLogging.m KWQMapImpl.h KWQMapImpl.mm KWQObject.mm KWQPageState.mm KWQPainter.mm KWQResourceLoader.mm KWQSignal.mm KWQSlot.mm KWQString.h KWQString.mm KWQTextArea.mm KWQTextCodec.mm KWQTextEdit.mm KWQTextField.mm KWQTimer.mm KWQValueListImpl.h KWQValueListImpl.mm WebCoreBridge.mm WebCoreCookieAdapter.m WebCoreGraphicsBridge.m WebCoreImageRendererFactory.m WebCoreKeyGenerator.m WebCoreTextRendererFactory.mm WebCoreViewFactory.m KWQAssertions.h KWQAssertions.m

Maciej mjs at opensource.apple.com
Tue Sep 27 15:37:45 PDT 2005


mjs         05/09/27 15:37:43

  Modified:    .        ChangeLog
               JavaScriptCore.xcodeproj project.pbxproj
               kjs      collector.cpp config.h function.cpp function.h
                        function_object.cpp identifier.cpp internal.cpp
                        internal.h nodes.h nodes2string.cpp
                        property_map.cpp scope_chain.h string_object.cpp
                        ustring.cpp ustring.h
               .        ChangeLog
               WebCore.xcodeproj project.pbxproj
               khtml    khtmlpart_p.h
               khtml/css css_base.h css_computedstyle.cpp css_ruleimpl.h
                        css_valueimpl.h cssstyleselector.h
               khtml/ecma domparser.h kjs_css.h kjs_dom.cpp kjs_dom.h
                        kjs_events.h kjs_html.cpp kjs_html.h kjs_range.h
                        kjs_traversal.h kjs_views.cpp kjs_views.h
                        kjs_window.cpp xmlhttprequest.h
               khtml/editing SelectionController.cpp
                        append_node_command.cpp apply_style_command.cpp
                        break_blockquote_command.cpp
                        composite_edit_command.cpp
                        delete_from_text_node_command.cpp
                        delete_selection_command.cpp edit_command.cpp
                        htmlediting.cpp insert_into_text_node_command.cpp
                        insert_line_break_command.cpp
                        insert_node_before_command.cpp
                        insert_paragraph_separator_command.cpp
                        insert_text_command.cpp join_text_nodes_command.cpp
                        markup.cpp merge_identical_elements_command.cpp
                        move_selection_command.cpp
                        rebalance_whitespace_command.cpp
                        remove_css_property_command.cpp
                        remove_node_attribute_command.cpp
                        remove_node_command.cpp
                        remove_node_preserving_children_command.cpp
                        replace_selection_command.cpp
                        set_node_attribute_command.cpp
                        split_element_command.cpp
                        split_text_node_command.cpp
                        split_text_node_containing_element.cpp
                        typing_command.cpp visible_position.cpp
                        visible_position.h
                        wrap_contents_in_dummy_span_command.cpp
               khtml/html html_imageimpl.h html_tableimpl.h htmlparser.cpp
               khtml/misc arena.cpp hashtable.h loader.cpp shared.h
               khtml/rendering render_style.h
               khtml/xml dom2_eventsimpl.h dom2_rangeimpl.h
                        dom2_traversalimpl.h dom2_viewsimpl.h dom_docimpl.h
                        dom_elementimpl.cpp dom_elementimpl.h
                        dom_nodeimpl.cpp dom_nodeimpl.h dom_position.cpp
                        dom_stringimpl.h
               kwq      DOM-CSS.mm DOM.mm DOMEvents.mm DOMHTML.mm
                        DOMInternal.mm DOMViews.mm KWQAccObject.mm
                        KWQAccObjectCache.mm KWQArrayImpl.h KWQArrayImpl.mm
                        KWQButton.mm KWQCString.mm KWQClipboard.h
                        KWQClipboard.mm KWQColor.mm KWQComboBox.mm
                        KWQEditCommand.mm KWQExceptions.h KWQFileButton.mm
                        KWQFontFamily.h KWQFormData.mm KWQKHTMLPart.h
                        KWQKHTMLPart.mm KWQKPartsBrowserInterface.mm
                        KWQKURL.mm KWQListBox.mm KWQListImpl.mm
                        KWQLogging.h KWQLogging.m KWQMapImpl.h
                        KWQMapImpl.mm KWQObject.mm KWQPageState.mm
                        KWQPainter.mm KWQResourceLoader.mm KWQSignal.mm
                        KWQSlot.mm KWQString.h KWQString.mm KWQTextArea.mm
                        KWQTextCodec.mm KWQTextEdit.mm KWQTextField.mm
                        KWQTimer.mm KWQValueListImpl.h KWQValueListImpl.mm
                        WebCoreBridge.mm WebCoreCookieAdapter.m
                        WebCoreGraphicsBridge.m
                        WebCoreImageRendererFactory.m WebCoreKeyGenerator.m
                        WebCoreTextRendererFactory.mm WebCoreViewFactory.m
  Added:       kxmlcore Assertions.h Assertions.mm FastMalloc.cpp
                        FastMalloc.h SharedPtr.h TCPageMap.h TCSpinLock.h
                        TCSystemAlloc.cpp TCSystemAlloc.h
               ForwardingHeaders/kxmlcore Assertions.h FastMalloc.h
                        SharedPtr.h
  Removed:     kjs      fast_malloc.cpp fast_malloc.h shared_ptr.h
               ForwardingHeaders/kjs shared_ptr.h
               ForwardingHeaders/misc main_thread_malloc.h
               khtml/misc main_thread_malloc.cpp main_thread_malloc.h
               kwq      KWQAssertions.h KWQAssertions.m
  Log:
  JavaScriptCore:
  
          Reviewed by John.
  
  	- replace dlmalloc with tcmalloc
  	http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
  
  	I also moved SharedPtr and the assertion code from WebCore into a
  	new kxmlcore directory.
  
          * JavaScriptCore.xcodeproj/project.pbxproj:
          * kjs/collector.cpp:
          (KJS::Collector::allocate):
          (KJS::Collector::collect):
          * kjs/config.h:
          * kjs/fast_malloc.cpp: Removed.
          * kjs/fast_malloc.h: Removed.
          * kjs/function.cpp:
          * kjs/function.h:
          * kjs/function_object.cpp:
          * kjs/identifier.cpp:
          (KJS::Identifier::add):
          * kjs/internal.cpp:
          * kjs/internal.h:
          * kjs/nodes.h:
          * kjs/nodes2string.cpp:
          * kjs/property_map.cpp:
          (KJS::PropertyMap::~PropertyMap):
          (KJS::PropertyMap::rehash):
          * kjs/scope_chain.h:
          * kjs/shared_ptr.h: Removed.
          * kjs/string_object.cpp:
          (StringObjectFuncImp::callAsFunction):
          * kjs/ustring.cpp:
          (KJS::UString::Rep::createCopying):
          (KJS::UString::Rep::destroy):
          (KJS::UString::expandCapacity):
          (KJS::UString::expandPreCapacity):
          (KJS::UString::UString):
          (KJS::UString::spliceSubstringsWithSeparators):
          (KJS::UString::append):
          (KJS::UString::operator=):
          (KJS::UString::detach):
          * kjs/ustring.h:
          * kxmlcore/Assertions.h: Added.
          * kxmlcore/Assertions.mm: Added.
          * kxmlcore/FastMalloc.cpp: Added.
          (KXMLCore::LgFloor):
          (KXMLCore::SizeClass):
          (KXMLCore::ByteSizeForClass):
          (KXMLCore::InitSizeClasses):
          (KXMLCore::MetaDataAlloc):
          (KXMLCore::PageHeapAllocator::Init):
          (KXMLCore::PageHeapAllocator::New):
          (KXMLCore::PageHeapAllocator::Delete):
          (KXMLCore::PageHeapAllocator::inuse):
          (KXMLCore::pages):
          (KXMLCore::AllocationSize):
          (KXMLCore::Event):
          (KXMLCore::NewSpan):
          (KXMLCore::DeleteSpan):
          (KXMLCore::DLL_Init):
          (KXMLCore::DLL_Remove):
          (KXMLCore::DLL_IsEmpty):
          (KXMLCore::DLL_Length):
          (KXMLCore::DLL_Print):
          (KXMLCore::DLL_Prepend):
          (KXMLCore::DLL_InsertOrdered):
          (KXMLCore::):
          (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
          (KXMLCore::TCMalloc_PageHeap::SystemBytes):
          (KXMLCore::TCMalloc_PageHeap::FreeBytes):
          (KXMLCore::TCMalloc_PageHeap::RecordSpan):
          (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
          (KXMLCore::TCMalloc_PageHeap::New):
          (KXMLCore::TCMalloc_PageHeap::Split):
          (KXMLCore::TCMalloc_PageHeap::Carve):
          (KXMLCore::TCMalloc_PageHeap::Delete):
          (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
          (KXMLCore::TCMalloc_PageHeap::Dump):
          (KXMLCore::TCMalloc_PageHeap::GrowHeap):
          (KXMLCore::TCMalloc_PageHeap::Check):
          (KXMLCore::TCMalloc_PageHeap::CheckList):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
          (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
          (KXMLCore::TCMalloc_ThreadCache::freelist_length):
          (KXMLCore::TCMalloc_ThreadCache::Size):
          (KXMLCore::TCMalloc_Central_FreeList::length):
          (KXMLCore::TCMalloc_Central_FreeList::Init):
          (KXMLCore::TCMalloc_Central_FreeList::Insert):
          (KXMLCore::TCMalloc_Central_FreeList::Remove):
          (KXMLCore::TCMalloc_Central_FreeList::Populate):
          (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
          (KXMLCore::TCMalloc_ThreadCache::Init):
          (KXMLCore::TCMalloc_ThreadCache::Cleanup):
          (KXMLCore::TCMalloc_ThreadCache::Allocate):
          (KXMLCore::TCMalloc_ThreadCache::Deallocate):
          (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
          (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
          (KXMLCore::TCMalloc_ThreadCache::Scavenge):
          (KXMLCore::TCMalloc_ThreadCache::GetCache):
          (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
          (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
          (KXMLCore::TCMalloc_ThreadCache::InitModule):
          (KXMLCore::TCMalloc_ThreadCache::InitTSD):
          (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
          (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
          (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
          (KXMLCore::TCMalloc_ThreadCache::Print):
          (KXMLCore::ExtractStats):
          (KXMLCore::DumpStats):
          (KXMLCore::PrintStats):
          (KXMLCore::DumpStackTraces):
          (KXMLCore::TCMallocImplementation::GetStats):
          (KXMLCore::TCMallocImplementation::ReadStackTraces):
          (KXMLCore::TCMallocImplementation::GetNumericProperty):
          (KXMLCore::TCMallocImplementation::SetNumericProperty):
          (KXMLCore::DoSampledAllocation):
          (KXMLCore::do_malloc):
          (KXMLCore::do_free):
          (KXMLCore::do_memalign):
          (KXMLCore::TCMallocGuard::TCMallocGuard):
          (KXMLCore::TCMallocGuard::~TCMallocGuard):
          (KXMLCore::malloc):
          (KXMLCore::free):
          (KXMLCore::calloc):
          (KXMLCore::cfree):
          (KXMLCore::realloc):
          (KXMLCore::memalign):
          (KXMLCore::posix_memalign):
          (KXMLCore::valloc):
          (KXMLCore::pvalloc):
          (KXMLCore::malloc_stats):
          (KXMLCore::mallopt):
          (KXMLCore::mallinfo):
          * kxmlcore/FastMalloc.h: Added.
          (KXMLCore::FastAllocated::operator new):
          (KXMLCore::FastAllocated::operator delete):
          (KXMLCore::FastAllocated::operator new[]):
          (KXMLCore::FastAllocated::operator delete[]):
          * kxmlcore/SharedPtr.h: Added.
          (KXMLCore::SharedPtr::SharedPtr):
          (KXMLCore::SharedPtr::~SharedPtr):
          (KXMLCore::SharedPtr::isNull):
          (KXMLCore::SharedPtr::notNull):
          (KXMLCore::SharedPtr::reset):
          (KXMLCore::SharedPtr::get):
          (KXMLCore::SharedPtr::operator*):
          (KXMLCore::SharedPtr::operator->):
          (KXMLCore::SharedPtr::operator!):
          (KXMLCore::SharedPtr::operator bool):
          (KXMLCore::::operator):
          (KXMLCore::operator==):
          (KXMLCore::operator!=):
          (KXMLCore::static_pointer_cast):
          (KXMLCore::const_pointer_cast):
          * kxmlcore/TCPageMap.h: Added.
          (TCMalloc_PageMap1::TCMalloc_PageMap1):
          (TCMalloc_PageMap1::Ensure):
          (TCMalloc_PageMap1::get):
          (TCMalloc_PageMap1::set):
          (TCMalloc_PageMap2::TCMalloc_PageMap2):
          (TCMalloc_PageMap2::get):
          (TCMalloc_PageMap2::set):
          (TCMalloc_PageMap2::Ensure):
          (TCMalloc_PageMap3::NewNode):
          (TCMalloc_PageMap3::TCMalloc_PageMap3):
          (TCMalloc_PageMap3::get):
          (TCMalloc_PageMap3::set):
          (TCMalloc_PageMap3::Ensure):
          * kxmlcore/TCSpinLock.h: Added.
          (TCMalloc_SpinLock::Init):
          (TCMalloc_SpinLock::Finalize):
          (TCMalloc_SpinLock::Lock):
          (TCMalloc_SpinLock::Unlock):
          (TCMalloc_SlowLock):
          (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
          (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
          * kxmlcore/TCSystemAlloc.cpp: Added.
          (TrySbrk):
          (TryMmap):
          (TryDevMem):
          (TCMalloc_SystemAlloc):
          * kxmlcore/TCSystemAlloc.h: Added.
  
  WebCore:
  
          Reviewed by John.
  
  	- replace dlmalloc with tcmalloc
  	http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
  
  	I also moved SharedPtr and the assertion code from WebCore into a
  	new kxmlcore directory.
  
          * ForwardingHeaders/kjs/shared_ptr.h: Removed.
          * ForwardingHeaders/kxmlcore/Assertions.h: Added.
          * ForwardingHeaders/kxmlcore/FastMalloc.h: Added.
          * ForwardingHeaders/kxmlcore/SharedPtr.h: Added.
          * ForwardingHeaders/misc/main_thread_malloc.h: Removed.
          * WebCore.xcodeproj/project.pbxproj:
          * khtml/css/css_base.h:
          * khtml/css/css_computedstyle.cpp:
          * khtml/css/css_ruleimpl.h:
          * khtml/css/css_valueimpl.h:
          * khtml/css/cssstyleselector.h:
          * khtml/ecma/domparser.h:
          * khtml/ecma/kjs_css.h:
          * khtml/ecma/kjs_dom.cpp:
          * khtml/ecma/kjs_dom.h:
          * khtml/ecma/kjs_events.h:
          * khtml/ecma/kjs_html.cpp:
          * khtml/ecma/kjs_html.h:
          * khtml/ecma/kjs_range.h:
          * khtml/ecma/kjs_traversal.h:
          * khtml/ecma/kjs_views.cpp:
          * khtml/ecma/kjs_views.h:
          * khtml/ecma/kjs_window.cpp:
          * khtml/ecma/xmlhttprequest.h:
          * khtml/editing/SelectionController.cpp:
          * khtml/editing/append_node_command.cpp:
          * khtml/editing/apply_style_command.cpp:
          * khtml/editing/break_blockquote_command.cpp:
          * khtml/editing/composite_edit_command.cpp:
          * khtml/editing/delete_from_text_node_command.cpp:
          * khtml/editing/delete_selection_command.cpp:
          * khtml/editing/edit_command.cpp:
          * khtml/editing/htmlediting.cpp:
          * khtml/editing/insert_into_text_node_command.cpp:
          * khtml/editing/insert_line_break_command.cpp:
          * khtml/editing/insert_node_before_command.cpp:
          * khtml/editing/insert_paragraph_separator_command.cpp:
          * khtml/editing/insert_text_command.cpp:
          * khtml/editing/join_text_nodes_command.cpp:
          * khtml/editing/markup.cpp:
          * khtml/editing/merge_identical_elements_command.cpp:
          * khtml/editing/move_selection_command.cpp:
          * khtml/editing/rebalance_whitespace_command.cpp:
          * khtml/editing/remove_css_property_command.cpp:
          * khtml/editing/remove_node_attribute_command.cpp:
          * khtml/editing/remove_node_command.cpp:
          * khtml/editing/remove_node_preserving_children_command.cpp:
          * khtml/editing/replace_selection_command.cpp:
          * khtml/editing/set_node_attribute_command.cpp:
          * khtml/editing/split_element_command.cpp:
          * khtml/editing/split_text_node_command.cpp:
          * khtml/editing/split_text_node_containing_element.cpp:
          * khtml/editing/typing_command.cpp:
          * khtml/editing/visible_position.cpp:
          * khtml/editing/visible_position.h:
          * khtml/editing/wrap_contents_in_dummy_span_command.cpp:
          * khtml/html/html_imageimpl.h:
          * khtml/html/html_tableimpl.h:
          * khtml/html/htmlparser.cpp:
          * khtml/khtmlpart_p.h:
          * khtml/misc/arena.cpp:
          (ArenaAllocate):
          (FreeArenaList):
          (ArenaFinish):
          * khtml/misc/hashtable.h:
          (khtml::HashTable::~HashTable):
          (khtml::::allocateTable):
          (khtml::::rehash):
          (khtml::::clear):
          (khtml::::HashTable):
          * khtml/misc/loader.cpp:
          * khtml/misc/main_thread_malloc.cpp: Removed.
          * khtml/misc/main_thread_malloc.h: Removed.
          * khtml/misc/shared.h:
          * khtml/rendering/render_style.h:
          * khtml/xml/dom2_eventsimpl.h:
          * khtml/xml/dom2_rangeimpl.h:
          * khtml/xml/dom2_traversalimpl.h:
          * khtml/xml/dom2_viewsimpl.h:
          * khtml/xml/dom_docimpl.h:
          * khtml/xml/dom_elementimpl.cpp:
          (NamedAttrMapImpl::clearAttributes):
          (NamedAttrMapImpl::operator=):
          (NamedAttrMapImpl::addAttribute):
          (NamedAttrMapImpl::removeAttribute):
          * khtml/xml/dom_elementimpl.h:
          * khtml/xml/dom_nodeimpl.cpp:
          * khtml/xml/dom_nodeimpl.h:
          * khtml/xml/dom_position.cpp:
          * khtml/xml/dom_stringimpl.h:
          * kwq/DOM-CSS.mm:
          * kwq/DOM.mm:
          * kwq/DOMEvents.mm:
          * kwq/DOMHTML.mm:
          * kwq/DOMInternal.mm:
          * kwq/DOMViews.mm:
          * kwq/KWQAccObject.mm:
          * kwq/KWQAccObjectCache.mm:
          * kwq/KWQArrayImpl.h:
          * kwq/KWQArrayImpl.mm:
          (KWQArrayImpl::KWQArrayPrivate::KWQArrayPrivate):
          (KWQArrayImpl::KWQArrayPrivate::~KWQArrayPrivate):
          (KWQArrayImpl::resize):
          * kwq/KWQAssertions.h: Removed.
          * kwq/KWQAssertions.m: Removed.
          * kwq/KWQButton.mm:
          * kwq/KWQCString.mm:
          * kwq/KWQClipboard.h:
          * kwq/KWQClipboard.mm:
          * kwq/KWQColor.mm:
          * kwq/KWQComboBox.mm:
          * kwq/KWQEditCommand.mm:
          * kwq/KWQExceptions.h:
          * kwq/KWQFileButton.mm:
          * kwq/KWQFontFamily.h:
          * kwq/KWQFormData.mm:
          * kwq/KWQKHTMLPart.h:
          * kwq/KWQKHTMLPart.mm:
          * kwq/KWQKPartsBrowserInterface.mm:
          * kwq/KWQKURL.mm:
          * kwq/KWQListBox.mm:
          * kwq/KWQListImpl.mm:
          * kwq/KWQLogging.h:
          * kwq/KWQLogging.m:
          * kwq/KWQMapImpl.h:
          * kwq/KWQMapImpl.mm:
          * kwq/KWQObject.mm:
          * kwq/KWQPageState.mm:
          * kwq/KWQPainter.mm:
          * kwq/KWQResourceLoader.mm:
          * kwq/KWQSignal.mm:
          * kwq/KWQSlot.mm:
          * kwq/KWQString.h:
          * kwq/KWQString.mm:
          (ALLOC_QCHAR):
          (QString::setBufferFromCFString):
          (allocatePageNode):
          * kwq/KWQTextArea.mm:
          * kwq/KWQTextCodec.mm:
          * kwq/KWQTextEdit.mm:
          * kwq/KWQTextField.mm:
          * kwq/KWQTimer.mm:
          * kwq/KWQValueListImpl.h:
          * kwq/KWQValueListImpl.mm:
          * kwq/WebCoreBridge.mm:
          * kwq/WebCoreCookieAdapter.m:
          * kwq/WebCoreGraphicsBridge.m:
          * kwq/WebCoreImageRendererFactory.m:
          * kwq/WebCoreKeyGenerator.m:
          * kwq/WebCoreTextRendererFactory.mm:
          * kwq/WebCoreViewFactory.m:
  
  Revision  Changes    Path
  1.838     +190 -0    JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.837
  retrieving revision 1.838
  diff -u -r1.837 -r1.838
  --- ChangeLog	24 Sep 2005 22:34:12 -0000	1.837
  +++ ChangeLog	27 Sep 2005 22:36:45 -0000	1.838
  @@ -1,3 +1,193 @@
  +2005-09-26  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by John.
  +
  +	- replace dlmalloc with tcmalloc
  +	http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
  +
  +	I also moved SharedPtr and the assertion code from WebCore into a
  +	new kxmlcore directory.
  +	
  +        * JavaScriptCore.xcodeproj/project.pbxproj:
  +        * kjs/collector.cpp:
  +        (KJS::Collector::allocate):
  +        (KJS::Collector::collect):
  +        * kjs/config.h:
  +        * kjs/fast_malloc.cpp: Removed.
  +        * kjs/fast_malloc.h: Removed.
  +        * kjs/function.cpp:
  +        * kjs/function.h:
  +        * kjs/function_object.cpp:
  +        * kjs/identifier.cpp:
  +        (KJS::Identifier::add):
  +        * kjs/internal.cpp:
  +        * kjs/internal.h:
  +        * kjs/nodes.h:
  +        * kjs/nodes2string.cpp:
  +        * kjs/property_map.cpp:
  +        (KJS::PropertyMap::~PropertyMap):
  +        (KJS::PropertyMap::rehash):
  +        * kjs/scope_chain.h:
  +        * kjs/shared_ptr.h: Removed.
  +        * kjs/string_object.cpp:
  +        (StringObjectFuncImp::callAsFunction):
  +        * kjs/ustring.cpp:
  +        (KJS::UString::Rep::createCopying):
  +        (KJS::UString::Rep::destroy):
  +        (KJS::UString::expandCapacity):
  +        (KJS::UString::expandPreCapacity):
  +        (KJS::UString::UString):
  +        (KJS::UString::spliceSubstringsWithSeparators):
  +        (KJS::UString::append):
  +        (KJS::UString::operator=):
  +        (KJS::UString::detach):
  +        * kjs/ustring.h:
  +        * kxmlcore/Assertions.h: Added.
  +        * kxmlcore/Assertions.mm: Added.
  +        * kxmlcore/FastMalloc.cpp: Added.
  +        (KXMLCore::LgFloor):
  +        (KXMLCore::SizeClass):
  +        (KXMLCore::ByteSizeForClass):
  +        (KXMLCore::InitSizeClasses):
  +        (KXMLCore::MetaDataAlloc):
  +        (KXMLCore::PageHeapAllocator::Init):
  +        (KXMLCore::PageHeapAllocator::New):
  +        (KXMLCore::PageHeapAllocator::Delete):
  +        (KXMLCore::PageHeapAllocator::inuse):
  +        (KXMLCore::pages):
  +        (KXMLCore::AllocationSize):
  +        (KXMLCore::Event):
  +        (KXMLCore::NewSpan):
  +        (KXMLCore::DeleteSpan):
  +        (KXMLCore::DLL_Init):
  +        (KXMLCore::DLL_Remove):
  +        (KXMLCore::DLL_IsEmpty):
  +        (KXMLCore::DLL_Length):
  +        (KXMLCore::DLL_Print):
  +        (KXMLCore::DLL_Prepend):
  +        (KXMLCore::DLL_InsertOrdered):
  +        (KXMLCore::):
  +        (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
  +        (KXMLCore::TCMalloc_PageHeap::SystemBytes):
  +        (KXMLCore::TCMalloc_PageHeap::FreeBytes):
  +        (KXMLCore::TCMalloc_PageHeap::RecordSpan):
  +        (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
  +        (KXMLCore::TCMalloc_PageHeap::New):
  +        (KXMLCore::TCMalloc_PageHeap::Split):
  +        (KXMLCore::TCMalloc_PageHeap::Carve):
  +        (KXMLCore::TCMalloc_PageHeap::Delete):
  +        (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
  +        (KXMLCore::TCMalloc_PageHeap::Dump):
  +        (KXMLCore::TCMalloc_PageHeap::GrowHeap):
  +        (KXMLCore::TCMalloc_PageHeap::Check):
  +        (KXMLCore::TCMalloc_PageHeap::CheckList):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
  +        (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
  +        (KXMLCore::TCMalloc_ThreadCache::freelist_length):
  +        (KXMLCore::TCMalloc_ThreadCache::Size):
  +        (KXMLCore::TCMalloc_Central_FreeList::length):
  +        (KXMLCore::TCMalloc_Central_FreeList::Init):
  +        (KXMLCore::TCMalloc_Central_FreeList::Insert):
  +        (KXMLCore::TCMalloc_Central_FreeList::Remove):
  +        (KXMLCore::TCMalloc_Central_FreeList::Populate):
  +        (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
  +        (KXMLCore::TCMalloc_ThreadCache::Init):
  +        (KXMLCore::TCMalloc_ThreadCache::Cleanup):
  +        (KXMLCore::TCMalloc_ThreadCache::Allocate):
  +        (KXMLCore::TCMalloc_ThreadCache::Deallocate):
  +        (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
  +        (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
  +        (KXMLCore::TCMalloc_ThreadCache::Scavenge):
  +        (KXMLCore::TCMalloc_ThreadCache::GetCache):
  +        (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
  +        (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
  +        (KXMLCore::TCMalloc_ThreadCache::InitModule):
  +        (KXMLCore::TCMalloc_ThreadCache::InitTSD):
  +        (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  +        (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
  +        (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
  +        (KXMLCore::TCMalloc_ThreadCache::Print):
  +        (KXMLCore::ExtractStats):
  +        (KXMLCore::DumpStats):
  +        (KXMLCore::PrintStats):
  +        (KXMLCore::DumpStackTraces):
  +        (KXMLCore::TCMallocImplementation::GetStats):
  +        (KXMLCore::TCMallocImplementation::ReadStackTraces):
  +        (KXMLCore::TCMallocImplementation::GetNumericProperty):
  +        (KXMLCore::TCMallocImplementation::SetNumericProperty):
  +        (KXMLCore::DoSampledAllocation):
  +        (KXMLCore::do_malloc):
  +        (KXMLCore::do_free):
  +        (KXMLCore::do_memalign):
  +        (KXMLCore::TCMallocGuard::TCMallocGuard):
  +        (KXMLCore::TCMallocGuard::~TCMallocGuard):
  +        (KXMLCore::malloc):
  +        (KXMLCore::free):
  +        (KXMLCore::calloc):
  +        (KXMLCore::cfree):
  +        (KXMLCore::realloc):
  +        (KXMLCore::memalign):
  +        (KXMLCore::posix_memalign):
  +        (KXMLCore::valloc):
  +        (KXMLCore::pvalloc):
  +        (KXMLCore::malloc_stats):
  +        (KXMLCore::mallopt):
  +        (KXMLCore::mallinfo):
  +        * kxmlcore/FastMalloc.h: Added.
  +        (KXMLCore::FastAllocated::operator new):
  +        (KXMLCore::FastAllocated::operator delete):
  +        (KXMLCore::FastAllocated::operator new[]):
  +        (KXMLCore::FastAllocated::operator delete[]):
  +        * kxmlcore/SharedPtr.h: Added.
  +        (KXMLCore::SharedPtr::SharedPtr):
  +        (KXMLCore::SharedPtr::~SharedPtr):
  +        (KXMLCore::SharedPtr::isNull):
  +        (KXMLCore::SharedPtr::notNull):
  +        (KXMLCore::SharedPtr::reset):
  +        (KXMLCore::SharedPtr::get):
  +        (KXMLCore::SharedPtr::operator*):
  +        (KXMLCore::SharedPtr::operator->):
  +        (KXMLCore::SharedPtr::operator!):
  +        (KXMLCore::SharedPtr::operator bool):
  +        (KXMLCore::::operator):
  +        (KXMLCore::operator==):
  +        (KXMLCore::operator!=):
  +        (KXMLCore::static_pointer_cast):
  +        (KXMLCore::const_pointer_cast):
  +        * kxmlcore/TCPageMap.h: Added.
  +        (TCMalloc_PageMap1::TCMalloc_PageMap1):
  +        (TCMalloc_PageMap1::Ensure):
  +        (TCMalloc_PageMap1::get):
  +        (TCMalloc_PageMap1::set):
  +        (TCMalloc_PageMap2::TCMalloc_PageMap2):
  +        (TCMalloc_PageMap2::get):
  +        (TCMalloc_PageMap2::set):
  +        (TCMalloc_PageMap2::Ensure):
  +        (TCMalloc_PageMap3::NewNode):
  +        (TCMalloc_PageMap3::TCMalloc_PageMap3):
  +        (TCMalloc_PageMap3::get):
  +        (TCMalloc_PageMap3::set):
  +        (TCMalloc_PageMap3::Ensure):
  +        * kxmlcore/TCSpinLock.h: Added.
  +        (TCMalloc_SpinLock::Init):
  +        (TCMalloc_SpinLock::Finalize):
  +        (TCMalloc_SpinLock::Lock):
  +        (TCMalloc_SpinLock::Unlock):
  +        (TCMalloc_SlowLock):
  +        (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
  +        (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
  +        * kxmlcore/TCSystemAlloc.cpp: Added.
  +        (TrySbrk):
  +        (TryMmap):
  +        (TryDevMem):
  +        (TCMalloc_SystemAlloc):
  +        * kxmlcore/TCSystemAlloc.h: Added.
  +
   2005-09-23  Maciej Stachowiak  <mjs at apple.com>
   
           Reviewed by Darin.
  
  
  
  1.13      +80 -18    JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
  
  Index: project.pbxproj
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- project.pbxproj	19 Sep 2005 06:57:25 -0000	1.12
  +++ project.pbxproj	27 Sep 2005 22:36:47 -0000	1.13
  @@ -25,12 +25,21 @@
   /* End PBXAggregateTarget section */
   
   /* Begin PBXBuildFile section */
  +		65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
  +		65162F0208E6A2D0007556CD /* SharedPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65162EEA08E6A1FE007556CD /* SharedPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		652C107F08DA7B1E0020887D /* protected_reference.h in Headers */ = {isa = PBXBuildFile; fileRef = 652C107E08DA7B1E0020887D /* protected_reference.h */; };
  +		6541BD7208E80A17002CBEE7 /* TCPageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6E08E80A17002CBEE7 /* TCPageMap.h */; };
  +		6541BD7308E80A17002CBEE7 /* TCSpinLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */; };
  +		6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */; };
  +		6541BD7508E80A17002CBEE7 /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */; };
   		65621E6D089E859700760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
   		65621E6E089E859700760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		65621E6F089E85D300760F35 /* property_slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65621E6B089E859700760F35 /* property_slot.cpp */; };
   		65621E70089E85D300760F35 /* property_slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* property_slot.h */; settings = {ATTRIBUTES = (Private, ); }; };
  -		65EF2DF508BECC80000894BB /* shared_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EF2DF408BECC80000894BB /* shared_ptr.h */; settings = {ATTRIBUTES = (Private, ); }; };
  +		65E217BD08E7EECC0023E5F6 /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E217B708E7EECC0023E5F6 /* Assertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
  +		65E217BE08E7EECC0023E5F6 /* Assertions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B808E7EECC0023E5F6 /* Assertions.mm */; };
  +		65E217BF08E7EECC0023E5F6 /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65E217B908E7EECC0023E5F6 /* FastMalloc.cpp */; };
  +		65E217C008E7EECC0023E5F6 /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E217BA08E7EECC0023E5F6 /* FastMalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		65EF2DF808BECC8A000894BB /* shared_ptr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65EF2DF408BECC80000894BB /* shared_ptr.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		930754C008B0F68000AB3056 /* pcre_compile.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754BF08B0F68000AB3056 /* pcre_compile.c */; };
   		930754C108B0F68000AB3056 /* pcre_compile.c in Sources */ = {isa = PBXBuildFile; fileRef = 930754BF08B0F68000AB3056 /* pcre_compile.c */; };
  @@ -111,7 +120,6 @@
   		932F5B8C0822A1C700736975 /* npapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CA3B4F06CC2166005600E3 /* npapi.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		932F5B8D0822A1C700736975 /* npruntime_priv.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DFF2C906CC36F6006F1ECC /* npruntime_priv.h */; };
   		932F5B8E0822A1C700736975 /* npruntime_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 84ABF1DE070B628C00A3AC05 /* npruntime_impl.h */; settings = {ATTRIBUTES = (Private, ); }; };
  -		932F5B8F0822A1C700736975 /* fast_malloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 651BDC78080F10CC00F10856 /* fast_malloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		932F5B920822A1C700736975 /* array_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A84D0255597D01FF60F7 /* array_object.cpp */; };
   		932F5B930822A1C700736975 /* bool_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8500255597D01FF60F7 /* bool_object.cpp */; };
   		932F5B940822A1C700736975 /* collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8520255597D01FF60F7 /* collector.cpp */; };
  @@ -170,7 +178,6 @@
   		932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51863FC406542D3100E9E8DD /* WebScriptObject.mm */; };
   		932F5BCF0822A1C700736975 /* jni_objc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 517EF37306D695930007C1BA /* jni_objc.mm */; };
   		932F5BD00822A1C700736975 /* softlinking.c in Sources */ = {isa = PBXBuildFile; fileRef = 8442A376074175C2000AE2ED /* softlinking.c */; };
  -		932F5BD10822A1C700736975 /* fast_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651BDC77080F10CC00F10856 /* fast_malloc.cpp */; };
   		932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
   		932F5BD40822A1C700736975 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A63D04B3B69F008AE952 /* CoreServices.framework */; };
   		932F5BD50822A1C700736975 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
  @@ -271,7 +278,6 @@
   		A85D823B087B2822006A9172 /* npapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CA3B4F06CC2166005600E3 /* npapi.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		A85D823C087B2822006A9172 /* npruntime_priv.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DFF2C906CC36F6006F1ECC /* npruntime_priv.h */; };
   		A85D823D087B2822006A9172 /* npruntime_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 84ABF1DE070B628C00A3AC05 /* npruntime_impl.h */; settings = {ATTRIBUTES = (Private, ); }; };
  -		A85D823E087B2822006A9172 /* fast_malloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 651BDC78080F10CC00F10856 /* fast_malloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
   		A85D823F087B2822006A9172 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (Private, ); }; };
   		A85D8241087B2822006A9172 /* array_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A84D0255597D01FF60F7 /* array_object.cpp */; };
   		A85D8242087B2822006A9172 /* bool_object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8500255597D01FF60F7 /* bool_object.cpp */; };
  @@ -332,7 +338,6 @@
   		A85D827D087B2822006A9172 /* WebScriptObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51863FC406542D3100E9E8DD /* WebScriptObject.mm */; };
   		A85D827E087B2822006A9172 /* jni_objc.mm in Sources */ = {isa = PBXBuildFile; fileRef = 517EF37306D695930007C1BA /* jni_objc.mm */; };
   		A85D827F087B2822006A9172 /* softlinking.c in Sources */ = {isa = PBXBuildFile; fileRef = 8442A376074175C2000AE2ED /* softlinking.c */; };
  -		A85D8280087B2822006A9172 /* fast_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651BDC77080F10CC00F10856 /* fast_malloc.cpp */; };
   		A85D8282087B2822006A9172 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
   		A85D8283087B2822006A9172 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A63D04B3B69F008AE952 /* CoreServices.framework */; };
   		A85D8284087B2822006A9172 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
  @@ -474,14 +479,17 @@
   		51F0EC9705C88DC700E6DF1B /* objc_utility.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = objc_utility.mm; path = bindings/objc/objc_utility.mm; sourceTree = "<group>"; };
   		650B68D80639033F009D42DE /* protected_values.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = protected_values.cpp; sourceTree = "<group>"; };
   		650B68D90639033F009D42DE /* protected_values.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protected_values.h; sourceTree = "<group>"; };
  -		651BDC77080F10CC00F10856 /* fast_malloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = fast_malloc.cpp; sourceTree = "<group>"; };
  -		651BDC78080F10CC00F10856 /* fast_malloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fast_malloc.h; sourceTree = "<group>"; };
  +		65162EEA08E6A1FE007556CD /* SharedPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SharedPtr.h; sourceTree = "<group>"; };
   		651F6412039D5B5F0078395C /* dtoa.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dtoa.cpp; sourceTree = "<group>"; };
   		651F6413039D5B5F0078395C /* dtoa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dtoa.h; sourceTree = "<group>"; };
   		652C107E08DA7B1E0020887D /* protected_reference.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protected_reference.h; sourceTree = "<group>"; };
   		6541720E039E08B90058BFEB /* dftables.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dftables.c; path = pcre/dftables.c; sourceTree = "<group>"; };
   		6541720F039E08B90058BFEB /* pcre.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pcre.h; path = pcre/pcre.h; sourceTree = "<group>"; };
   		65417217039E0B280058BFEB /* pcre-config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "pcre-config.h"; path = "pcre/pcre-config.h"; sourceTree = "<group>"; };
  +		6541BD6E08E80A17002CBEE7 /* TCPageMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TCPageMap.h; sourceTree = "<group>"; };
  +		6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TCSpinLock.h; sourceTree = "<group>"; };
  +		6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TCSystemAlloc.cpp; sourceTree = "<group>"; };
  +		6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TCSystemAlloc.h; sourceTree = "<group>"; };
   		6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
   		6560A63D04B3B69F008AE952 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
   		65621E6B089E859700760F35 /* property_slot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = property_slot.cpp; sourceTree = "<group>"; };
  @@ -489,6 +497,11 @@
   		65AB004806261CBA0076DE63 /* interpreter_map.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = interpreter_map.cpp; sourceTree = "<group>"; };
   		65AB004906261CBA0076DE63 /* interpreter_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interpreter_map.h; sourceTree = "<group>"; };
   		65C02FBB0637462A003E7EE6 /* protect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = protect.h; sourceTree = "<group>"; };
  +		65DE646F08E8C88A005D002A /* fast_malloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fast_malloc.h; sourceTree = "<group>"; };
  +		65E217B708E7EECC0023E5F6 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = "<group>"; };
  +		65E217B808E7EECC0023E5F6 /* Assertions.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = Assertions.mm; sourceTree = "<group>"; };
  +		65E217B908E7EECC0023E5F6 /* FastMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FastMalloc.cpp; sourceTree = "<group>"; };
  +		65E217BA08E7EECC0023E5F6 /* FastMalloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FastMalloc.h; sourceTree = "<group>"; };
   		65EF2DF408BECC80000894BB /* shared_ptr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = shared_ptr.h; sourceTree = "<group>"; };
   		700DA117065984CE00747C0B /* WebScriptObjectPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = WebScriptObjectPrivate.h; path = bindings/objc/WebScriptObjectPrivate.h; sourceTree = "<group>"; };
   		704FD35305697E6D003DBED9 /* bool_object.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = bool_object.h; sourceTree = "<group>"; };
  @@ -651,6 +664,7 @@
   			isa = PBXGroup;
   			children = (
   				65417200039E01BA0058BFEB /* kjs */,
  +				65162EF108E6A21C007556CD /* kxmlcore */,
   				51856D950562EE9C008B9D83 /* bindings */,
   				65417203039E01F90058BFEB /* pcre */,
   				932FC3C20824BB70005B3C75 /* Resources */,
  @@ -811,6 +825,22 @@
   			name = bindings;
   			sourceTree = "<group>";
   		};
  +		65162EF108E6A21C007556CD /* kxmlcore */ = {
  +			isa = PBXGroup;
  +			children = (
  +				6541BD6E08E80A17002CBEE7 /* TCPageMap.h */,
  +				6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */,
  +				6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */,
  +				6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */,
  +				65162EEA08E6A1FE007556CD /* SharedPtr.h */,
  +				65E217B708E7EECC0023E5F6 /* Assertions.h */,
  +				65E217B808E7EECC0023E5F6 /* Assertions.mm */,
  +				65E217B908E7EECC0023E5F6 /* FastMalloc.cpp */,
  +				65E217BA08E7EECC0023E5F6 /* FastMalloc.h */,
  +			);
  +			path = kxmlcore;
  +			sourceTree = "<group>";
  +		};
   		65417200039E01BA0058BFEB /* kjs */ = {
   			isa = PBXGroup;
   			children = (
  @@ -864,12 +894,11 @@
   		F5C290E50284F960018635CA /* Other Sources */ = {
   			isa = PBXGroup;
   			children = (
  -				651BDC77080F10CC00F10856 /* fast_malloc.cpp */,
  -				651BDC78080F10CC00F10856 /* fast_malloc.h */,
   				45E12D8806A49B0F00E9DF84 /* testkjs.cpp */,
   				F692A8540255597D01FF60F7 /* create_hash_table */,
   				93F1981A08245AAE001E9ABC /* keywords.table */,
   				933A3499038AE7C6008635CE /* grammar.y */,
  +				65DE646F08E8C88A005D002A /* fast_malloc.h */,
   				F692A8650255597D01FF60F7 /* lexer.cpp */,
   				F692A8660255597D01FF60F7 /* lexer.h */,
   				F68EBB8C0255D4C601FF60F7 /* config.h */,
  @@ -956,7 +985,6 @@
   				932F5B8C0822A1C700736975 /* npapi.h in Headers */,
   				932F5B8D0822A1C700736975 /* npruntime_priv.h in Headers */,
   				932F5B8E0822A1C700736975 /* npruntime_impl.h in Headers */,
  -				932F5B8F0822A1C700736975 /* fast_malloc.h in Headers */,
   				932FC11D0824A6A3005B3C75 /* create_hash_table in Headers */,
   				65621E6E089E859700760F35 /* property_slot.h in Headers */,
   				93E26BE608B1517100F85226 /* pcre_internal.h in Headers */,
  @@ -964,8 +992,13 @@
   				93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */,
   				93E26C1308B1523D00F85226 /* ucptable.c in Headers */,
   				93E26CCF08B2921900F85226 /* softlinking.h in Headers */,
  -				65EF2DF508BECC80000894BB /* shared_ptr.h in Headers */,
   				652C107F08DA7B1E0020887D /* protected_reference.h in Headers */,
  +				65162EEB08E6A1FE007556CD /* SharedPtr.h in Headers */,
  +				65E217BD08E7EECC0023E5F6 /* Assertions.h in Headers */,
  +				65E217C008E7EECC0023E5F6 /* FastMalloc.h in Headers */,
  +				6541BD7208E80A17002CBEE7 /* TCPageMap.h in Headers */,
  +				6541BD7308E80A17002CBEE7 /* TCSpinLock.h in Headers */,
  +				6541BD7508E80A17002CBEE7 /* TCSystemAlloc.h in Headers */,
   			);
   			runOnlyForDeploymentPostprocessing = 0;
   		};
  @@ -973,6 +1006,7 @@
   			isa = PBXHeadersBuildPhase;
   			buildActionMask = 2147483647;
   			files = (
  +				65162F0208E6A2D0007556CD /* SharedPtr.h in Headers */,
   				A85D81F8087B2822006A9172 /* array_object.h in Headers */,
   				A85D81F9087B2822006A9172 /* collector.h in Headers */,
   				A85D81FA087B2822006A9172 /* date_object.h in Headers */,
  @@ -1042,7 +1076,6 @@
   				A85D823B087B2822006A9172 /* npapi.h in Headers */,
   				A85D823C087B2822006A9172 /* npruntime_priv.h in Headers */,
   				A85D823D087B2822006A9172 /* npruntime_impl.h in Headers */,
  -				A85D823E087B2822006A9172 /* fast_malloc.h in Headers */,
   				65621E70089E85D300760F35 /* property_slot.h in Headers */,
   				A85D823F087B2822006A9172 /* create_hash_table in Headers */,
   				93E26BE708B1517100F85226 /* pcre_internal.h in Headers */,
  @@ -1596,7 +1629,6 @@
   				932F5BCE0822A1C700736975 /* WebScriptObject.mm in Sources */,
   				932F5BCF0822A1C700736975 /* jni_objc.mm in Sources */,
   				932F5BD00822A1C700736975 /* softlinking.c in Sources */,
  -				932F5BD10822A1C700736975 /* fast_malloc.cpp in Sources */,
   				65621E6D089E859700760F35 /* property_slot.cpp in Sources */,
   				930754C108B0F68000AB3056 /* pcre_compile.c in Sources */,
   				930754D008B0F74600AB3056 /* pcre_tables.c in Sources */,
  @@ -1609,6 +1641,9 @@
   				93E26BD408B1514100F85226 /* pcre_xclass.c in Sources */,
   				93E26CF708B29A1C00F85226 /* pcre_get.c in Sources */,
   				93E26DDC08B2A4F400F85226 /* pcre_printint.c in Sources */,
  +				65E217BE08E7EECC0023E5F6 /* Assertions.mm in Sources */,
  +				65E217BF08E7EECC0023E5F6 /* FastMalloc.cpp in Sources */,
  +				6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */,
   			);
   			runOnlyForDeploymentPostprocessing = 0;
   		};
  @@ -1691,7 +1726,6 @@
   				A85D827D087B2822006A9172 /* WebScriptObject.mm in Sources */,
   				A85D827E087B2822006A9172 /* jni_objc.mm in Sources */,
   				A85D827F087B2822006A9172 /* softlinking.c in Sources */,
  -				A85D8280087B2822006A9172 /* fast_malloc.cpp in Sources */,
   				65621E6F089E85D300760F35 /* property_slot.cpp in Sources */,
   				930754C008B0F68000AB3056 /* pcre_compile.c in Sources */,
   				930754CF08B0F74600AB3056 /* pcre_tables.c in Sources */,
  @@ -1800,7 +1834,10 @@
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
   				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
   				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
  -				HEADER_SEARCH_PATHS = icu;
  +				HEADER_SEARCH_PATHS = (
  +					icu,
  +					.,
  +				);
   				INFOPLIST_FILE = Info.plist;
   				INSTALL_PATH = /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks;
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
  @@ -1853,7 +1890,10 @@
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
   				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
   				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
  -				HEADER_SEARCH_PATHS = icu;
  +				HEADER_SEARCH_PATHS = (
  +					icu,
  +					.,
  +				);
   				INFOPLIST_FILE = Info.plist;
   				INSTALL_PATH = /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks;
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
  @@ -1906,7 +1946,10 @@
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
   				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
   				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
  -				HEADER_SEARCH_PATHS = icu;
  +				HEADER_SEARCH_PATHS = (
  +					icu,
  +					.,
  +				);
   				INFOPLIST_FILE = Info.plist;
   				INSTALL_PATH = /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks;
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
  @@ -1959,7 +2002,10 @@
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
   				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
   				GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
  -				HEADER_SEARCH_PATHS = icu;
  +				HEADER_SEARCH_PATHS = (
  +					icu,
  +					.,
  +				);
   				INFOPLIST_FILE = Info.plist;
   				INSTALL_PATH = /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks;
   				OTHER_CFLAGS = "";
  @@ -2208,6 +2254,10 @@
   				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
   				GCC_OPTIMIZATION_LEVEL = 0;
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
  +				HEADER_SEARCH_PATHS = (
  +					"-I",
  +					.,
  +				);
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
   				PREBINDING = NO;
   				PRODUCT_NAME = testkjs;
  @@ -2235,6 +2285,10 @@
   				GCC_ENABLE_CPP_EXCEPTIONS = NO;
   				GCC_ENABLE_CPP_RTTI = NO;
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
  +				HEADER_SEARCH_PATHS = (
  +					"-I",
  +					.,
  +				);
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
   				PREBINDING = NO;
   				PRODUCT_NAME = testkjs;
  @@ -2263,6 +2317,10 @@
   				GCC_ENABLE_CPP_RTTI = NO;
   				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
  +				HEADER_SEARCH_PATHS = (
  +					"-I",
  +					.,
  +				);
   				MACOSX_DEPLOYMENT_TARGET = 10.3;
   				PREBINDING = NO;
   				PRODUCT_NAME = testkjs;
  @@ -2290,6 +2348,10 @@
   				GCC_ENABLE_CPP_EXCEPTIONS = NO;
   				GCC_ENABLE_CPP_RTTI = NO;
   				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
  +				HEADER_SEARCH_PATHS = (
  +					"-I",
  +					.,
  +				);
   				PRODUCT_NAME = testkjs;
   				WARNING_CFLAGS = (
   					"-Wall",
  
  
  
  1.46      +9 -9      JavaScriptCore/kjs/collector.cpp
  
  Index: collector.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/collector.cpp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- collector.cpp	4 Sep 2005 06:21:54 -0000	1.45
  +++ collector.cpp	27 Sep 2005 22:36:48 -0000	1.46
  @@ -21,7 +21,7 @@
   
   #include "collector.h"
   
  -#include "fast_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "internal.h"
   #include "list.h"
   #include "value.h"
  @@ -118,10 +118,10 @@
       if (usedOversizeCells == numOversizeCells) {
         numOversizeCells = max(MIN_ARRAY_SIZE, numOversizeCells * GROWTH_FACTOR);
         heap.numOversizeCells = numOversizeCells;
  -      heap.oversizeCells = static_cast<CollectorCell **>(kjs_fast_realloc(heap.oversizeCells, numOversizeCells * sizeof(CollectorCell *)));
  +      heap.oversizeCells = static_cast<CollectorCell **>(fastRealloc(heap.oversizeCells, numOversizeCells * sizeof(CollectorCell *)));
       }
       
  -    void *newCell = kjs_fast_malloc(s);
  +    void *newCell = fastMalloc(s);
       heap.oversizeCells[usedOversizeCells] = static_cast<CollectorCell *>(newCell);
       heap.usedOversizeCells = usedOversizeCells + 1;
       heap.numLiveObjects = numLiveObjects + 1;
  @@ -156,10 +156,10 @@
       if (usedBlocks == numBlocks) {
         numBlocks = max(MIN_ARRAY_SIZE, numBlocks * GROWTH_FACTOR);
         heap.numBlocks = numBlocks;
  -      heap.blocks = static_cast<CollectorBlock **>(kjs_fast_realloc(heap.blocks, numBlocks * sizeof(CollectorBlock *)));
  +      heap.blocks = static_cast<CollectorBlock **>(fastRealloc(heap.blocks, numBlocks * sizeof(CollectorBlock *)));
       }
   
  -    targetBlock = static_cast<CollectorBlock *>(kjs_fast_calloc(1, sizeof(CollectorBlock)));
  +    targetBlock = static_cast<CollectorBlock *>(fastCalloc(1, sizeof(CollectorBlock)));
       targetBlock->freeList = targetBlock->cells;
       targetBlockUsedCells = 0;
       heap.blocks[usedBlocks] = targetBlock;
  @@ -454,7 +454,7 @@
         emptyBlocks++;
         if (emptyBlocks > SPARE_EMPTY_BLOCKS) {
   #if !DEBUG_COLLECTOR
  -        kjs_fast_free(curBlock);
  +        fastFree(curBlock);
   #endif
           // swap with the last block so we compact as we go
           heap.blocks[block] = heap.blocks[heap.usedBlocks - 1];
  @@ -463,7 +463,7 @@
   
           if (heap.numBlocks > MIN_ARRAY_SIZE && heap.usedBlocks < heap.numBlocks / LOW_WATER_FACTOR) {
             heap.numBlocks = heap.numBlocks / GROWTH_FACTOR; 
  -          heap.blocks = (CollectorBlock **)kjs_fast_realloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *));
  +          heap.blocks = (CollectorBlock **)fastRealloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *));
           }
         }
       }
  @@ -481,7 +481,7 @@
   #if DEBUG_COLLECTOR
         heap.oversizeCells[cell]->u.freeCell.zeroIfFree = 0;
   #else
  -      kjs_fast_free(imp);
  +      fastFree(imp);
   #endif
   
         // swap with the last oversize cell so we compact as we go
  @@ -492,7 +492,7 @@
   
         if (heap.numOversizeCells > MIN_ARRAY_SIZE && heap.usedOversizeCells < heap.numOversizeCells / LOW_WATER_FACTOR) {
           heap.numOversizeCells = heap.numOversizeCells / GROWTH_FACTOR; 
  -        heap.oversizeCells = (CollectorCell **)kjs_fast_realloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *));
  +        heap.oversizeCells = (CollectorCell **)fastRealloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *));
         }
       } else {
         imp->m_marked = false;
  
  
  
  1.9       +6 -0      JavaScriptCore/kjs/config.h
  
  Index: config.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/config.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- config.h	4 Sep 2005 01:18:10 -0000	1.8
  +++ config.h	27 Sep 2005 22:36:48 -0000	1.9
  @@ -19,6 +19,10 @@
   #define HAVE_ICU 1
   #define HAVE_PCREPOSIX 1
   #define HAVE_STRING_H 1
  +#define HAVE_STDINT_H 1
  +
  +#define HAVE_MMAP 1
  +#define HAVE_SBRK 1
   
   #ifdef __ppc__
   #define WORDS_BIGENDIAN 1
  @@ -26,3 +30,5 @@
   
   /* define to debug garbage collection */
   #undef DEBUG_COLLECTOR
  +
  +#define KXC_CHANGES 1
  
  
  
  1.59      +0 -3      JavaScriptCore/kjs/function.cpp
  
  Index: function.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/function.cpp,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- function.cpp	4 Sep 2005 06:21:54 -0000	1.58
  +++ function.cpp	27 Sep 2005 22:36:48 -0000	1.59
  @@ -31,7 +31,6 @@
   #include "operations.h"
   #include "debugger.h"
   #include "context.h"
  -#include "shared_ptr.h"
   
   #include <stdio.h>
   #include <errno.h>
  @@ -42,8 +41,6 @@
   
   #include <unicode/uchar.h>
   
  -using namespace KXMLCore;
  -
   namespace KJS {
   
   // ----------------------------- FunctionImp ----------------------------------
  
  
  
  1.35      +1 -1      JavaScriptCore/kjs/function.h
  
  Index: function.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/function.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- function.h	4 Sep 2005 01:18:11 -0000	1.34
  +++ function.h	27 Sep 2005 22:36:49 -0000	1.35
  @@ -81,7 +81,7 @@
   
       virtual Completion execute(ExecState *exec);
       CodeType codeType() const { return FunctionCode; }
  -    KXMLCore::SharedPtr<FunctionBodyNode> body;
  +    SharedPtr<FunctionBodyNode> body;
   
       virtual const ClassInfo *classInfo() const { return &info; }
       static const ClassInfo info;
  
  
  
  1.32      +0 -1      JavaScriptCore/kjs/function_object.cpp
  
  Index: function_object.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/function_object.cpp,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- function_object.cpp	30 Aug 2005 23:56:14 -0000	1.31
  +++ function_object.cpp	27 Sep 2005 22:36:49 -0000	1.32
  @@ -34,7 +34,6 @@
   #include <string.h>
   
   using namespace KJS;
  -using namespace KXMLCore;
   
   // ------------------------------ FunctionPrototypeImp -------------------------
   
  
  
  
  1.20      +3 -3      JavaScriptCore/kjs/identifier.cpp
  
  Index: identifier.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/identifier.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- identifier.cpp	4 Sep 2005 21:38:32 -0000	1.19
  +++ identifier.cpp	27 Sep 2005 22:36:49 -0000	1.20
  @@ -35,7 +35,7 @@
   
   #include "identifier.h"
   
  -#include "fast_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include <string.h> // for strlen
   #include <new> // for placement new
   
  @@ -126,7 +126,7 @@
           i = (i + 1) & _tableSizeMask;
       }
       
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * length));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length));
       for (int j = 0; j != length; j++)
           d[j] = c[j];
       
  @@ -165,7 +165,7 @@
           i = (i + 1) & _tableSizeMask;
       }
       
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * length));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length));
       for (int j = 0; j != length; j++)
           d[j] = s[j];
       
  
  
  
  1.73      +0 -2      JavaScriptCore/kjs/internal.cpp
  
  Index: internal.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/internal.cpp,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- internal.cpp	21 Sep 2005 01:10:54 -0000	1.72
  +++ internal.cpp	27 Sep 2005 22:36:49 -0000	1.73
  @@ -52,8 +52,6 @@
   
   extern int kjsyyparse();
   
  -using namespace KXMLCore;
  -
   namespace KJS {
   
   #if !APPLE_CHANGES
  
  
  
  1.41      +4 -4      JavaScriptCore/kjs/internal.h
  
  Index: internal.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/internal.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- internal.h	19 Sep 2005 06:57:27 -0000	1.40
  +++ internal.h	27 Sep 2005 22:36:49 -0000	1.41
  @@ -32,7 +32,7 @@
   #include "types.h"
   #include "interpreter.h"
   #include "scope_chain.h"
  -#include "shared_ptr.h"
  +#include <kxmlcore/SharedPtr.h>
   
   #if !WIN32
   #define KJS_MULTIPLE_THREADS 1
  @@ -202,9 +202,9 @@
      */
     class Parser {
     public:
  -    static KXMLCore::SharedPtr<ProgramNode> parse(const UString &sourceURL, int startingLineNumber,
  -                                                  const UChar *code, unsigned int length, int *sourceId = 0,
  -                                                  int *errLine = 0, UString *errMsg = 0);
  +    static SharedPtr<ProgramNode> parse(const UString &sourceURL, int startingLineNumber,
  +                                        const UChar *code, unsigned int length, int *sourceId = 0,
  +                                        int *errLine = 0, UString *errMsg = 0);
       static void accept(ProgramNode *prog);
   
       static void saveNewNode(Node *node);
  
  
  
  1.36      +119 -121  JavaScriptCore/kjs/nodes.h
  
  Index: nodes.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/nodes.h,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- nodes.h	24 Sep 2005 22:34:13 -0000	1.35
  +++ nodes.h	27 Sep 2005 22:36:50 -0000	1.36
  @@ -25,8 +25,8 @@
   #ifndef _NODES_H_
   #define _NODES_H_
   
  -#include "fast_malloc.h"
  -#include "shared_ptr.h"
  +#include <kxmlcore/FastMalloc.h>
  +#include <kxmlcore/SharedPtr.h>
   
   #include "internal.h"
   //#include "debugger.h"
  @@ -77,13 +77,11 @@
   		  OpInstanceOf
     };
   
  -  class Node {
  +  class Node : public FastAllocated {
     public:
       Node();
       virtual ~Node();
   
  -    KJS_FAST_ALLOCATED;
  -
       virtual ValueImp *evaluate(ExecState *exec) = 0;
       UString toString() const;
       virtual void streamTo(SourceStream &s) const = 0;
  @@ -225,7 +223,7 @@
       }
           
     private:
  -    KXMLCore::SharedPtr<Node> group;
  +    SharedPtr<Node> group;
     };
   
     class ElementNode : public Node {
  @@ -238,9 +236,9 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class ArrayNode;
  -    KXMLCore::SharedPtr<ElementNode> list;
  +    SharedPtr<ElementNode> list;
       int elision;
  -    KXMLCore::SharedPtr<Node> node;
  +    SharedPtr<Node> node;
     };
   
     class ArrayNode : public Node {
  @@ -253,7 +251,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<ElementNode> element;
  +    SharedPtr<ElementNode> element;
       int elision;
       bool opt;
     };
  @@ -269,9 +267,9 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class ObjectLiteralNode;
  -    KXMLCore::SharedPtr<PropertyNode> name;
  -    KXMLCore::SharedPtr<Node> assign;
  -    KXMLCore::SharedPtr<PropertyValueNode> list;
  +    SharedPtr<PropertyNode> name;
  +    SharedPtr<Node> assign;
  +    SharedPtr<PropertyValueNode> list;
     };
   
     class ObjectLiteralNode : public Node {
  @@ -281,7 +279,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<PropertyValueNode> list;
  +    SharedPtr<PropertyValueNode> list;
     };
   
     class PropertyNode : public Node {
  @@ -307,8 +305,8 @@
       Node *subscript() { return expr2.get(); }
   
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
     };
   
     class DotAccessorNode : public Node {
  @@ -323,7 +321,7 @@
       const Identifier& identifier() const { return ident; }
   
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
       Identifier ident;
     };
   
  @@ -338,8 +336,8 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class ArgumentsNode;
  -    KXMLCore::SharedPtr<ArgumentListNode> list;
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<ArgumentListNode> list;
  +    SharedPtr<Node> expr;
     };
   
     class ArgumentsNode : public Node {
  @@ -351,7 +349,7 @@
       List evaluateList(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<ArgumentListNode> list;
  +    SharedPtr<ArgumentListNode> list;
     };
   
     class NewExprNode : public Node {
  @@ -361,8 +359,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<ArgumentsNode> args;
  +    SharedPtr<Node> expr;
  +    SharedPtr<ArgumentsNode> args;
     };
   
     class FunctionCallValueNode : public Node {
  @@ -371,8 +369,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<ArgumentsNode> args;
  +    SharedPtr<Node> expr;
  +    SharedPtr<ArgumentsNode> args;
     };
   
     class FunctionCallResolveNode : public Node {
  @@ -382,7 +380,7 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       Identifier ident;
  -    KXMLCore::SharedPtr<ArgumentsNode> args;
  +    SharedPtr<ArgumentsNode> args;
     };
   
     class FunctionCallBracketNode : public Node {
  @@ -391,9 +389,9 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     protected:
  -    KXMLCore::SharedPtr<Node> base;
  -    KXMLCore::SharedPtr<Node> subscript;
  -    KXMLCore::SharedPtr<ArgumentsNode> args;
  +    SharedPtr<Node> base;
  +    SharedPtr<Node> subscript;
  +    SharedPtr<ArgumentsNode> args;
     };
   
     class FunctionCallParenBracketNode : public FunctionCallBracketNode {
  @@ -408,9 +406,9 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     protected:
  -    KXMLCore::SharedPtr<Node> base;
  +    SharedPtr<Node> base;
       Identifier ident;
  -    KXMLCore::SharedPtr<ArgumentsNode> args;
  +    SharedPtr<ArgumentsNode> args;
     };
   
     class FunctionCallParenDotNode : public FunctionCallDotNode {
  @@ -435,8 +433,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  -    KXMLCore::SharedPtr<Node> m_subscript;
  +    SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_subscript;
       Operator m_oper;
     };
   
  @@ -446,7 +444,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_base;
       Identifier m_ident;
       Operator m_oper;
     };
  @@ -466,8 +464,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  -    KXMLCore::SharedPtr<Node> m_subscript;
  +    SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_subscript;
     };
   
     class DeleteDotNode : public Node {
  @@ -476,7 +474,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_base;
       Identifier m_ident;
     };
   
  @@ -486,7 +484,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_expr;
  +    SharedPtr<Node> m_expr;
     };
   
     class VoidNode : public Node {
  @@ -495,7 +493,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class TypeOfResolveNode : public Node {
  @@ -513,7 +511,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_expr;
  +    SharedPtr<Node> m_expr;
     };
   
     class PrefixResolveNode : public Node {
  @@ -532,8 +530,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  -    KXMLCore::SharedPtr<Node> m_subscript;
  +    SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_subscript;
       Operator m_oper;
     };
   
  @@ -543,7 +541,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_base;
       Identifier m_ident;
       Operator m_oper;
     };
  @@ -554,7 +552,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class NegateNode : public Node {
  @@ -563,7 +561,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class BitwiseNotNode : public Node {
  @@ -572,7 +570,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class LogicalNotNode : public Node {
  @@ -581,7 +579,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class MultNode : public Node {
  @@ -590,8 +588,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> term1;
  -    KXMLCore::SharedPtr<Node> term2;
  +    SharedPtr<Node> term1;
  +    SharedPtr<Node> term2;
       char oper;
     };
   
  @@ -601,8 +599,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> term1;
  -    KXMLCore::SharedPtr<Node> term2;
  +    SharedPtr<Node> term1;
  +    SharedPtr<Node> term2;
       char oper;
     };
   
  @@ -613,8 +611,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> term1;
  -    KXMLCore::SharedPtr<Node> term2;
  +    SharedPtr<Node> term1;
  +    SharedPtr<Node> term2;
       Operator oper;
     };
   
  @@ -625,8 +623,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
       Operator oper;
     };
   
  @@ -637,8 +635,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
       Operator oper;
     };
   
  @@ -649,8 +647,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
       Operator oper;
     };
   
  @@ -664,8 +662,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
       Operator oper;
     };
   
  @@ -679,9 +677,9 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> logical;
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> logical;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
     };
   
     class AssignResolveNode : public Node {
  @@ -693,7 +691,7 @@
     protected:
       Identifier m_ident;
       Operator m_oper;
  -    KXMLCore::SharedPtr<Node> m_right;
  +    SharedPtr<Node> m_right;
     };
   
     class AssignBracketNode : public Node {
  @@ -703,10 +701,10 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     protected:
  -    KXMLCore::SharedPtr<Node> m_base;
  -    KXMLCore::SharedPtr<Node> m_subscript;
  +    SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_subscript;
       Operator m_oper;
  -    KXMLCore::SharedPtr<Node> m_right;
  +    SharedPtr<Node> m_right;
     };
   
     class AssignDotNode : public Node {
  @@ -716,10 +714,10 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     protected:
  -    KXMLCore::SharedPtr<Node> m_base;
  +    SharedPtr<Node> m_base;
       Identifier m_ident;
       Operator m_oper;
  -    KXMLCore::SharedPtr<Node> m_right;
  +    SharedPtr<Node> m_right;
     };
   
     class CommaNode : public Node {
  @@ -728,8 +726,8 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
     };
   
     class StatListNode : public StatementNode {
  @@ -742,8 +740,8 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class CaseClauseNode;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  -    KXMLCore::SharedPtr<StatListNode> list;
  +    SharedPtr<StatementNode> statement;
  +    SharedPtr<StatListNode> list;
     };
   
     class AssignExprNode : public Node {
  @@ -752,7 +750,7 @@
       ValueImp *evaluate(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class VarDeclNode : public Node {
  @@ -765,7 +763,7 @@
     private:
       Type varType;
       Identifier ident;
  -    KXMLCore::SharedPtr<AssignExprNode> init;
  +    SharedPtr<AssignExprNode> init;
     };
   
     class VarDeclListNode : public Node {
  @@ -780,8 +778,8 @@
     private:
       friend class ForNode;
       friend class VarStatementNode;
  -    KXMLCore::SharedPtr<VarDeclListNode> list;
  -    KXMLCore::SharedPtr<VarDeclNode> var;
  +    SharedPtr<VarDeclListNode> list;
  +    SharedPtr<VarDeclNode> var;
     };
   
     class VarStatementNode : public StatementNode {
  @@ -791,7 +789,7 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<VarDeclListNode> list;
  +    SharedPtr<VarDeclListNode> list;
     };
   
     class BlockNode : public StatementNode {
  @@ -801,7 +799,7 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     protected:
  -    KXMLCore::SharedPtr<SourceElementsNode> source;
  +    SharedPtr<SourceElementsNode> source;
     };
   
     class EmptyStatementNode : public StatementNode {
  @@ -817,7 +815,7 @@
       virtual Completion execute(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class IfNode : public StatementNode {
  @@ -828,9 +826,9 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<StatementNode> statement1;
  -    KXMLCore::SharedPtr<StatementNode> statement2;
  +    SharedPtr<Node> expr;
  +    SharedPtr<StatementNode> statement1;
  +    SharedPtr<StatementNode> statement2;
     };
   
     class DoWhileNode : public StatementNode {
  @@ -840,8 +838,8 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<StatementNode> statement;
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<StatementNode> statement;
  +    SharedPtr<Node> expr;
     };
   
     class WhileNode : public StatementNode {
  @@ -851,8 +849,8 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  +    SharedPtr<Node> expr;
  +    SharedPtr<StatementNode> statement;
     };
   
     class ForNode : public StatementNode {
  @@ -865,10 +863,10 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr1;
  -    KXMLCore::SharedPtr<Node> expr2;
  -    KXMLCore::SharedPtr<Node> expr3;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  +    SharedPtr<Node> expr1;
  +    SharedPtr<Node> expr2;
  +    SharedPtr<Node> expr3;
  +    SharedPtr<StatementNode> statement;
     };
   
     class ForInNode : public StatementNode {
  @@ -880,11 +878,11 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       Identifier ident;
  -    KXMLCore::SharedPtr<AssignExprNode> init;
  -    KXMLCore::SharedPtr<Node> lexpr;
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<VarDeclNode> varDecl;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  +    SharedPtr<AssignExprNode> init;
  +    SharedPtr<Node> lexpr;
  +    SharedPtr<Node> expr;
  +    SharedPtr<VarDeclNode> varDecl;
  +    SharedPtr<StatementNode> statement;
     };
   
     class ContinueNode : public StatementNode {
  @@ -913,7 +911,7 @@
       virtual Completion execute(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> value;
  +    SharedPtr<Node> value;
     };
   
     class WithNode : public StatementNode {
  @@ -923,8 +921,8 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  +    SharedPtr<Node> expr;
  +    SharedPtr<StatementNode> statement;
     };
   
     class CaseClauseNode : public Node {
  @@ -937,8 +935,8 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<StatListNode> list;
  +    SharedPtr<Node> expr;
  +    SharedPtr<StatListNode> list;
     };
   
     class ClauseListNode : public Node {
  @@ -954,8 +952,8 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class CaseBlockNode;
  -    KXMLCore::SharedPtr<CaseClauseNode> cl;
  -    KXMLCore::SharedPtr<ClauseListNode> nx;
  +    SharedPtr<CaseClauseNode> cl;
  +    SharedPtr<ClauseListNode> nx;
     };
   
     class CaseBlockNode : public Node {
  @@ -966,9 +964,9 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<ClauseListNode> list1;
  -    KXMLCore::SharedPtr<CaseClauseNode> def;
  -    KXMLCore::SharedPtr<ClauseListNode> list2;
  +    SharedPtr<ClauseListNode> list1;
  +    SharedPtr<CaseClauseNode> def;
  +    SharedPtr<ClauseListNode> list2;
     };
   
     class SwitchNode : public StatementNode {
  @@ -978,8 +976,8 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  -    KXMLCore::SharedPtr<CaseBlockNode> block;
  +    SharedPtr<Node> expr;
  +    SharedPtr<CaseBlockNode> block;
     };
   
     class LabelNode : public StatementNode {
  @@ -990,7 +988,7 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       Identifier label;
  -    KXMLCore::SharedPtr<StatementNode> statement;
  +    SharedPtr<StatementNode> statement;
     };
   
     class ThrowNode : public StatementNode {
  @@ -999,7 +997,7 @@
       virtual Completion execute(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<Node> expr;
  +    SharedPtr<Node> expr;
     };
   
     class CatchNode : public StatementNode {
  @@ -1011,7 +1009,7 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       Identifier ident;
  -    KXMLCore::SharedPtr<StatementNode> block;
  +    SharedPtr<StatementNode> block;
     };
   
     class FinallyNode : public StatementNode {
  @@ -1021,7 +1019,7 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<StatementNode> block;
  +    SharedPtr<StatementNode> block;
     };
   
     class TryNode : public StatementNode {
  @@ -1036,9 +1034,9 @@
       virtual void processVarDecls(ExecState *exec);
       virtual void streamTo(SourceStream &s) const;
     private:
  -    KXMLCore::SharedPtr<StatementNode> block;
  -    KXMLCore::SharedPtr<CatchNode> _catch;
  -    KXMLCore::SharedPtr<FinallyNode> _final;
  +    SharedPtr<StatementNode> block;
  +    SharedPtr<CatchNode> _catch;
  +    SharedPtr<FinallyNode> _final;
     };
   
     class ParameterNode : public Node {
  @@ -1055,7 +1053,7 @@
       friend class FuncDeclNode;
       friend class FuncExprNode;
       Identifier id;
  -    KXMLCore::SharedPtr<ParameterNode> next;
  +    SharedPtr<ParameterNode> next;
     };
   
     // inherited by ProgramNode
  @@ -1078,8 +1076,8 @@
       friend class FuncDeclNode;
   
       Identifier ident;
  -    KXMLCore::SharedPtr<ParameterNode> param;
  -    KXMLCore::SharedPtr<FunctionBodyNode> body;
  +    SharedPtr<ParameterNode> param;
  +    SharedPtr<FunctionBodyNode> body;
     };
   
     class FuncDeclNode : public StatementNode {
  @@ -1094,8 +1092,8 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       Identifier ident;
  -    KXMLCore::SharedPtr<ParameterNode> param;
  -    KXMLCore::SharedPtr<FunctionBodyNode> body;
  +    SharedPtr<ParameterNode> param;
  +    SharedPtr<FunctionBodyNode> body;
     };
   
     // A linked list of source element nodes
  @@ -1111,8 +1109,8 @@
       virtual void streamTo(SourceStream &s) const;
     private:
       friend class BlockNode;
  -    KXMLCore::SharedPtr<StatementNode> element; // 'this' element
  -    KXMLCore::SharedPtr<SourceElementsNode> elements; // pointer to next
  +    SharedPtr<StatementNode> element; // 'this' element
  +    SharedPtr<SourceElementsNode> elements; // pointer to next
     };
   
     class ProgramNode : public FunctionBodyNode {
  
  
  
  1.18      +0 -2      JavaScriptCore/kjs/nodes2string.cpp
  
  Index: nodes2string.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/nodes2string.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- nodes2string.cpp	24 Sep 2005 22:34:14 -0000	1.17
  +++ nodes2string.cpp	27 Sep 2005 22:36:50 -0000	1.18
  @@ -23,8 +23,6 @@
   
   #include "nodes.h"
   
  -using KXMLCore::SharedPtr;
  -
   namespace KJS {
     /**
      * A simple text streaming class that helps with code indentation.
  
  
  
  1.49      +4 -4      JavaScriptCore/kjs/property_map.cpp
  
  Index: property_map.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/property_map.cpp,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- property_map.cpp	19 Sep 2005 06:57:27 -0000	1.48
  +++ property_map.cpp	27 Sep 2005 22:36:50 -0000	1.49
  @@ -21,7 +21,7 @@
   
   #include "property_map.h"
   
  -#include "fast_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "object.h"
   #include "protect.h"
   #include "reference_list.h"
  @@ -122,7 +122,7 @@
           else
               ++minimumKeysToProcess;
       }
  -    kjs_fast_free(_table);
  +    fastFree(_table);
   }
   
   void PropertyMap::clear()
  @@ -424,7 +424,7 @@
       int oldTableSize = oldTable ? oldTable->size : 0;
       int oldTableKeyCount = oldTable ? oldTable->keyCount : 0;
       
  -    _table = (Table *)kjs_fast_calloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );
  +    _table = (Table *)fastCalloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );
       _table->size = newTableSize;
       _table->sizeMask = newTableSize - 1;
       _table->keyCount = oldTableKeyCount;
  @@ -458,7 +458,7 @@
       }
       _table->lastIndexUsed = lastIndexUsed;
   
  -    kjs_fast_free(oldTable);
  +    fastFree(oldTable);
   
       checkConsistency();
   }
  
  
  
  1.11      +2 -4      JavaScriptCore/kjs/scope_chain.h
  
  Index: scope_chain.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/scope_chain.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- scope_chain.h	12 Aug 2005 23:20:48 -0000	1.10
  +++ scope_chain.h	27 Sep 2005 22:36:50 -0000	1.11
  @@ -22,19 +22,17 @@
   #ifndef KJS_SCOPE_CHAIN_H
   #define KJS_SCOPE_CHAIN_H
   
  -#include "fast_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   namespace KJS {
   
       class ObjectImp;
       
  -    class ScopeChainNode {
  +    class ScopeChainNode : public FastAllocated {
       public:
           ScopeChainNode(ScopeChainNode *n, ObjectImp *o)
               : next(n), object(o), refCount(1) { }
   
  -        KJS_FAST_ALLOCATED;
  -
           ScopeChainNode *next;
           ObjectImp *object;
           int refCount;
  
  
  
  1.46      +1 -1      JavaScriptCore/kjs/string_object.cpp
  
  Index: string_object.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/string_object.cpp,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- string_object.cpp	19 Sep 2005 06:57:28 -0000	1.45
  +++ string_object.cpp	27 Sep 2005 22:36:50 -0000	1.46
  @@ -765,7 +765,7 @@
   {
     UString s;
     if (args.size()) {
  -    UChar *buf = static_cast<UChar *>(kjs_fast_malloc(args.size() * sizeof(UChar)));
  +    UChar *buf = static_cast<UChar *>(fastMalloc(args.size() * sizeof(UChar)));
       UChar *p = buf;
       ListIterator it = args.begin();
       while (it != args.end()) {
  
  
  
  1.61      +15 -16    JavaScriptCore/kjs/ustring.cpp
  
  Index: ustring.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/ustring.cpp,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ustring.cpp	16 Sep 2005 22:42:30 -0000	1.60
  +++ ustring.cpp	27 Sep 2005 22:36:50 -0000	1.61
  @@ -35,7 +35,6 @@
   #include <strings.h>
   #endif
   
  -#include "fast_malloc.h"
   #include "ustring.h"
   #include "operations.h"
   #include "identifier.h"
  @@ -179,7 +178,7 @@
   UString::Rep *UString::Rep::createCopying(const UChar *d, int l)
   {
     int sizeInBytes = l * sizeof(UChar);
  -  UChar *copyD = static_cast<UChar *>(kjs_fast_malloc(sizeInBytes));
  +  UChar *copyD = static_cast<UChar *>(fastMalloc(sizeInBytes));
     memcpy(copyD, d, sizeInBytes);
   
     return create(copyD, l);
  @@ -238,7 +237,7 @@
     if (baseString) {
       baseString->deref();
     } else {
  -    kjs_fast_free(buf);
  +    fastFree(buf);
     }
     delete this;
   }
  @@ -360,7 +359,7 @@
   
     if (requiredLength > r->capacity) {
       int newCapacity = expandedSize(requiredLength, r->preCapacity);
  -    r->buf = static_cast<UChar *>(kjs_fast_realloc(r->buf, newCapacity * sizeof(UChar)));
  +    r->buf = static_cast<UChar *>(fastRealloc(r->buf, newCapacity * sizeof(UChar)));
       r->capacity = newCapacity - r->preCapacity;
     }
     if (requiredLength > r->usedCapacity) {
  @@ -376,9 +375,9 @@
       int newCapacity = expandedSize(requiredPreCap, r->capacity);
       int delta = newCapacity - r->capacity - r->preCapacity;
   
  -    UChar *newBuf = static_cast<UChar *>(kjs_fast_malloc(newCapacity * sizeof(UChar)));
  +    UChar *newBuf = static_cast<UChar *>(fastMalloc(newCapacity * sizeof(UChar)));
       memcpy(newBuf + delta, r->buf, (r->capacity + r->preCapacity) * sizeof(UChar));
  -    kjs_fast_free(r->buf);
  +    fastFree(r->buf);
       r->buf = newBuf;
   
       r->preCapacity = newCapacity - r->capacity;
  @@ -391,7 +390,7 @@
   
   UString::UString(char c)
   {
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar)));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar)));
       d[0] = c;
       rep = Rep::create(d, 1);
   }
  @@ -407,7 +406,7 @@
       attach(&Rep::empty);
       return;
     }
  -  UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * length));
  +  UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length));
     for (int i = 0; i < length; i++)
       d[i].uc = c[i];
     rep = Rep::create(d, length);
  @@ -472,7 +471,7 @@
     } else {
       // a does not qualify for append, and b does not qualify for prepend, gotta make a whole new string
       int newCapacity = expandedSize(length, 0);
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * newCapacity));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity));
       memcpy(d, a.data(), aSize * sizeof(UChar));
       memcpy(d + aSize, b.data(), bSize * sizeof(UChar));
       rep = Rep::create(d, length);
  @@ -643,7 +642,7 @@
       totalLength += separators[i].size();
     }
   
  -  UChar *buffer = static_cast<UChar *>(kjs_fast_malloc(totalLength * sizeof(UChar)));
  +  UChar *buffer = static_cast<UChar *>(fastMalloc(totalLength * sizeof(UChar)));
   
     int maxCount = max(rangeCount, separatorCount);
     int bufferPos = 0;
  @@ -696,7 +695,7 @@
     } else {
       // this is shared with someone using more capacity, gotta make a whole new string
       int newCapacity = expandedSize(length, 0);
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * newCapacity));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity));
       memcpy(d, data(), thisSize * sizeof(UChar));
       memcpy(const_cast<UChar *>(d + thisSize), t.data(), tSize * sizeof(UChar));
       release();
  @@ -740,7 +739,7 @@
     } else {
       // this is shared with someone using more capacity, gotta make a whole new string
       int newCapacity = expandedSize(length, 0);
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * newCapacity));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity));
       memcpy(d, data(), thisSize * sizeof(UChar));
       for (int i = 0; i < tSize; ++i)
         d[thisSize+i] = t[i];
  @@ -761,7 +760,7 @@
     if (length == 0) {
       // this is empty - must make a new rep because we don't want to pollute the shared empty one 
       int newCapacity = expandedSize(1, 0);
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * newCapacity));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity));
       d[0] = c;
       release();
       rep = Rep::create(d, 1);
  @@ -784,7 +783,7 @@
     } else {
       // this is shared with someone using more capacity, gotta make a whole new string
       int newCapacity = expandedSize((length + 1), 0);
  -    UChar *d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * newCapacity));
  +    UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity));
       memcpy(d, data(), length * sizeof(UChar));
       d[length] = c;
       release();
  @@ -846,7 +845,7 @@
       rep->_hash = 0;
     } else {
       release();
  -    d = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * l));
  +    d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * l));
       rep = Rep::create(d, l);
     }
     for (int i = 0; i < l; i++)
  @@ -1152,7 +1151,7 @@
   {
     if (rep->rc > 1 || rep->baseString) {
       int l = size();
  -    UChar *n = static_cast<UChar *>(kjs_fast_malloc(sizeof(UChar) * l));
  +    UChar *n = static_cast<UChar *>(fastMalloc(sizeof(UChar) * l));
       memcpy(n, data(), l * sizeof(UChar));
       release();
       rep = Rep::create(n, l);
  
  
  
  1.41      +5 -6      JavaScriptCore/kjs/ustring.h
  
  Index: ustring.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/ustring.h,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- ustring.h	16 Sep 2005 22:42:30 -0000	1.40
  +++ ustring.h	27 Sep 2005 22:36:50 -0000	1.41
  @@ -24,7 +24,7 @@
   #ifndef _KJS_USTRING_H_
   #define _KJS_USTRING_H_
   
  -#include "fast_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   #if APPLE_CHANGES
   #include <sys/types.h>
  @@ -193,7 +193,7 @@
     /**
      * @short Unicode string class
      */
  -  class UString {
  +  class UString : public FastAllocated {
       friend bool operator==(const UString&, const UString&);
       friend class UCharReference;
       friend class Identifier;
  @@ -204,6 +204,9 @@
        * @internal
        */
       struct Rep {
  +
  +      FAST_ALLOCATED_POD;
  +
         static Rep *create(UChar *d, int l);
         static Rep *createCopying(const UChar *d, int l);
         static Rep *create(Rep *base, int offset, int length);
  @@ -216,8 +219,6 @@
         static unsigned computeHash(const UChar *, int length);
         static unsigned computeHash(const char *);
   
  -      KJS_FAST_ALLOCATED;
  -
         void ref() { ++rc; }
         void deref() { if (--rc == 0) destroy(); }
   
  @@ -291,8 +292,6 @@
        */
       ~UString() { release(); }
   
  -    KJS_FAST_ALLOCATED;
  -
       /**
        * Constructs a string from an int.
        */
  
  
  
  1.1                  JavaScriptCore/kxmlcore/Assertions.h
  
  Index: Assertions.h
  ===================================================================
  // -*- mode: c++; c-basic-offset: 4 -*-
  /*
   * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   *
   * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
   * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
   * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   */
  
  #ifndef KXMLCORE_ASSERTIONS_H
  #define KXMLCORE_ASSERTIONS_H
  
  // no namespaces because this file has to be includable from C and Objective-C
  
  // Note, this file uses many GCC extensions, but it should be compatible with
  // C, Objective C, C++, and Objective C++.
  
  // For non-debug builds, everything is disabled by default.
  // Defining any of the symbols explicitly prevents this from having any effect.
  
  #ifdef NDEBUG
  #define ASSERTIONS_DISABLED_DEFAULT 1
  #else
  #define ASSERTIONS_DISABLED_DEFAULT 0
  #endif
  
  #ifndef ASSERT_DISABLED
  #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
  #endif
  
  #ifndef ASSERT_ARG_DISABLED
  #define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT
  #endif
  
  #ifndef FATAL_DISABLED
  #define FATAL_DISABLED ASSERTIONS_DISABLED_DEFAULT
  #endif
  
  #ifndef ERROR_DISABLED
  #define ERROR_DISABLED ASSERTIONS_DISABLED_DEFAULT
  #endif
  
  #ifndef LOG_DISABLED
  #define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
  #endif
  
  // These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled.
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  typedef enum { KXCLogChannelUninitialized, KXCLogChannelOff, KXCLogChannelOn } KXCLogChannelState;
  
  typedef struct {
      unsigned mask;
      const char *defaultName;
      KXCLogChannelState state;
  } KXCLogChannel;
      
  void KXCReportAssertionFailure(const char *file, int line, const char *function, const char *assertion);
  void KXCReportAssertionFailureWithMessage(const char *file, int line, const char *function, const char *assertion, const char *format, ...);
  void KXCReportArgumentAssertionFailure(const char *file, int line, const char *function, const char *argName, const char *assertion);
  void KXCReportFatalError(const char *file, int line, const char *function, const char *format, ...) ;
  void KXCReportError(const char *file, int line, const char *function, const char *format, ...);
  void KXCLog(const char *file, int line, const char *function, KXCLogChannel *channel, const char *format, ...);
  
  #ifdef __cplusplus
  }
  #endif
  
  // CRASH -- gets us into the debugger or the crash reporter -- signals are ignored by the crash reporter so we must do better
  
  #define CRASH() *(int *)0xbbadbeef = 0
  
  // ASSERT, ASSERT_WITH_MESSAGE, ASSERT_NOT_REACHED
  
  #if ASSERT_DISABLED
  
  #define ASSERT(assertion) ((void)0)
  #define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) ((void)0)
  #define ASSERT_NOT_REACHED() ((void)0)
  
  #else
  
  #define ASSERT(assertion) do \
      if (!(assertion)) { \
          KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion); \
          CRASH(); \
      } \
  while (0)
  #define ASSERT_WITH_MESSAGE(assertion, formatAndArgs...) do \
      if (!(assertion)) { \
          KXCReportAssertionFailureWithMessage(__FILE__, __LINE__, __PRETTY_FUNCTION__, #assertion, formatAndArgs); \
          CRASH(); \
      } \
  while (0)
  #define ASSERT_NOT_REACHED() do { \
      KXCReportAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, 0); \
      CRASH(); \
  } while (0)
  
  #endif
  
  // ASSERT_ARG
  
  #if ASSERT_ARG_DISABLED
  
  #define ASSERT_ARG(argName, assertion) ((void)0)
  
  #else
  
  #define ASSERT_ARG(argName, assertion) do \
      if (!(assertion)) { \
          KXCReportArgumentAssertionFailure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #argName, #assertion); \
          CRASH(); \
      } \
  while (0)
  
  #endif
  
  // FATAL
  
  #if FATAL_DISABLED
  #define FATAL(formatAndArgs...) ((void)0)
  #else
  #define FATAL(formatAndArgs...) do { \
      KXCReportFatalError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs); \
      CRASH(); \
  } while (0)
  #endif
  
  // ERROR
  
  #if ERROR_DISABLED
  #define ERROR(formatAndArgs...) ((void)0)
  #else
  #define ERROR(formatAndArgs...) KXCReportError(__FILE__, __LINE__, __PRETTY_FUNCTION__, formatAndArgs)
  #endif
  
  // LOG
  
  #if LOG_DISABLED
  #define LOG(channel, formatAndArgs...) ((void)0)
  #else
  #define LOG(channel, formatAndArgs...) KXCLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), formatAndArgs)
  #define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
  #define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
  #endif
  
  #endif // KXMLCORE_ASSERTIONS_H
  
  
  
  1.1                  JavaScriptCore/kxmlcore/Assertions.mm
  
  Index: Assertions.mm
  ===================================================================
  // -*- mode: c++; c-basic-offset: 4 -*-
  /*
   * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   *
   * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
   * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
   * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   */
  
  #include "Assertions.h"
  
  #define SUPPORT_OBJC_LOGGING 1
  
  #if SUPPORT_OBJC_LOGGING
  #include <CoreFoundation/CFString.h>
  #endif
  
  #include <Foundation/NSString.h>
  #include <Foundation/NSUserDefaults.h>
  #include <Foundation/NSScanner.h>
  
  extern "C" {
  
  static int (* vfprintf_no_warning)(FILE *, const char *, va_list) = vfprintf;
  
  static void vprintf_stderr_objc(const char *format, va_list args)
  {
  #if SUPPORT_OBJC_LOGGING
      if (!strstr(format, "%@")) {
          CFStringRef cfFormat = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
          CFStringRef str = CFStringCreateWithFormatAndArguments(NULL, NULL, cfFormat, args);
          
          int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
          char *buffer = (char *)malloc(length + 1);
  
          CFStringGetCString(str, buffer, length, kCFStringEncodingUTF8);
  
          fputs(buffer, stderr);
  
          free(buffer);
          CFRelease(str);
          CFRelease(cfFormat);
      } else
  #endif
          vfprintf_no_warning(stderr, format, args);
  }
  
  void KXCReportAssertionFailure(const char *file, int line, const char *function, const char *assertion)
  {
      if (assertion)
          fprintf(stderr, "=================\nASSERTION FAILED: %s (%s:%d %s)\n=================\n", assertion, file, line, function);
      else
          fprintf(stderr, "=================\nSHOULD NEVER BE REACHED (%s:%d %s)\n=================\n", file, line, function);
  }
  
  void KXCReportAssertionFailureWithMessage(const char *file, int line, const char *function, const char *assertion, const char *format, ...)
  {
      fprintf(stderr, "=================\nASSERTION FAILED: ");
      va_list args;
      va_start(args, format);
      vprintf_stderr_objc(format, args);
      va_end(args);
      fprintf(stderr, "\n%s (%s:%d %s)\n=================\n", assertion, file, line, function);
  }
  
  void KXCReportArgumentAssertionFailure(const char *file, int line, const char *function, const char *argName, const char *assertion)
  {
      fprintf(stderr, "=================\nARGUMENT BAD: %s, %s (%s:%d %s)\n=================\n", argName, assertion, file, line, function);
  }
  
  void KXCReportFatalError(const char *file, int line, const char *function, const char *format, ...)
  {
      fprintf(stderr, "=================\nFATAL ERROR: ");
      va_list args;
      va_start(args, format);
      vprintf_stderr_objc(format, args);
      va_end(args);
      fprintf(stderr, "\n(%s:%d %s)\n=================\n", file, line, function);
  }
  
  void KXCReportError(const char *file, int line, const char *function, const char *format, ...)
  {
      fprintf(stderr, "=================\nERROR: ");
      va_list args;
      va_start(args, format);
      vprintf_stderr_objc(format, args);
      va_end(args);
      fprintf(stderr, "\n(%s:%d %s)\n=================\n", file, line, function);
  }
  
  static void fprintf_objc(const char *format, ...)
  {
      va_list args;
      va_start(args, format);
      vprintf_stderr_objc(format, args);
      va_end(args);
  }
  
  
  void KXCLog(const char *file, int line, const char *function, KXCLogChannel *channel, const char *format, ...)
  {
      if (channel->state == KXCLogChannelUninitialized) {
          channel->state = KXCLogChannelOff;
          NSString *logLevelString = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithCString:channel->defaultName]];
          if (logLevelString) {
              unsigned logLevel;
              if (![[NSScanner scannerWithString:logLevelString] scanHexInt:&logLevel]) {
                  fprintf_objc("unable to parse hex value for %s (%@), logging is off", channel->defaultName, logLevelString);
              }
              if ((logLevel & channel->mask) == channel->mask) {
                  channel->state = KXCLogChannelOn;
              }
          }
      }
      
      if (channel->state != KXCLogChannelOn)
          return;
      
      va_list args;
      va_start(args, format);
      vprintf_stderr_objc(format, args);
      va_end(args);
      if (format[strlen(format) - 1] != '\n')
          putc('\n', stderr);
  }
  
  } // extern "C"
  
  
  
  1.1                  JavaScriptCore/kxmlcore/FastMalloc.cpp
  
  Index: FastMalloc.cpp
  ===================================================================
  // Copyright (c) 2005, Google Inc.
  // All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are
  // met:
  // 
  //     * Redistributions of source code must retain the above copyright
  // notice, this list of conditions and the following disclaimer.
  //     * Redistributions in binary form must reproduce the above
  // copyright notice, this list of conditions and the following disclaimer
  // in the documentation and/or other materials provided with the
  // distribution.
  //     * Neither the name of Google Inc. nor the names of its
  // contributors may be used to endorse or promote products derived from
  // this software without specific prior written permission.
  // 
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  // ---
  // Author: Sanjay Ghemawat <opensource at google.com>
  //
  // A malloc that uses a per-thread cache to satisfy small malloc requests.
  // (The time for malloc/free of a small object drops from 300 ns to 50 ns.)
  //
  // See doc/tcmalloc.html for a high-level
  // description of how this malloc works.
  //
  // SYNCHRONIZATION
  //  1. The thread-specific lists are accessed without acquiring any locks.
  //     This is safe because each such list is only accessed by one thread.
  //  2. We have a lock per central free-list, and hold it while manipulating
  //     the central free list for a particular size.
  //  3. The central page allocator is protected by "pageheap_lock".
  //  4. The pagemap (which maps from page-number to descriptor),
  //     can be read without holding any locks, and written while holding
  //     the "pageheap_lock".
  //
  //     This multi-threaded access to the pagemap is safe for fairly
  //     subtle reasons.  We basically assume that when an object X is
  //     allocated by thread A and deallocated by thread B, there must
  //     have been appropriate synchronization in the handoff of object
  //     X from thread A to thread B.
  //
  // TODO: Bias reclamation to larger addresses
  // TODO: implement mallinfo/mallopt
  // TODO: Better testing
  // TODO: Return memory to system
  //
  // 9/28/2003 (new page-level allocator replaces ptmalloc2):
  // * malloc/free of small objects goes from ~300 ns to ~50 ns.
  // * allocation of a reasonably complicated struct
  //   goes from about 1100 ns to about 300 ns.
  
  #include "FastMalloc.h"
  
  #ifndef NDEBUG
  #define USE_SYSTEM_MALLOC 1
  #endif
  
  #if USE_SYSTEM_MALLOC
  
  #include <stdlib.h>
  
  namespace KXMLCore {
      
  void *fastMalloc(size_t n) 
  {
      return malloc(n);
  }
  
  void *fastCalloc(size_t n_elements, size_t element_size)
  {
      return calloc(n_elements, element_size);
  }
  
  void fastFree(void* p)
  {
      free(p);
  }
  
  void *fastRealloc(void* p, size_t n)
  {
      return realloc(p, n);
  }
  
  } // namespace KJS
  
  #else
  
  #include "config.h"
  #include <new>
  #include <stdio.h>
  #include <stddef.h>
  #if defined HAVE_STDINT_H
  #include <stdint.h>
  #elif defined HAVE_INTTYPES_H
  #include <inttypes.h>
  #else
  #include <sys/types.h>
  #endif
  #include <string.h>
  #include <pthread.h>
  #include <unistd.h>
  #include <errno.h>
  #include <stdarg.h>
  #include "TCSpinLock.h"
  #include "TCPageMap.h"
  #include "TCSystemAlloc.h"
  
  #include "Assertions.h"
  
  #if KXC_CHANGES
  namespace KXMLCore {
  
  #define malloc fastMalloc
  #define calloc fastCalloc
  #define free fastFree
  #define realloc fastRealloc
  
  #define MESSAGE ERROR
  #define CHECK_CONDITION ASSERT
  
  #endif
  
  #if defined HAVE_INTTYPES_H
  #define __STDC_FORMAT_MACROS
  #include <inttypes.h>
  #define LLU   PRIu64
  #else
  #define LLU   "llu"              // hope for the best
  #endif
  
  //-------------------------------------------------------------------
  // Configuration
  //-------------------------------------------------------------------
  
  // Not all possible combinations of the following parameters make
  // sense.  In particular, if kMaxSize increases, you may have to
  // increase kNumClasses as well.
  static const size_t kPageShift  = 12;
  static const size_t kPageSize   = 1 << kPageShift;
  static const size_t kMaxSize    = 8u * kPageSize;
  static const size_t kAlignShift = 3;
  static const size_t kAlignment  = 1 << kAlignShift;
  static const size_t kNumClasses = 170;
  
  // Minimum number of pages to fetch from system at a time.  Must be
  // significantly bigger than kBlockSize to amortize system-call
  // overhead, and also to reduce external fragementation.  Also, we
  // should keep this value big because various incarnations of Linux
  // have small limits on the number of mmap() regions per
  // address-space.
  static const size_t kMinSystemAlloc = 1 << (20 - kPageShift);
  
  // Number of objects to move between a per-thread list and a central
  // list in one shot.  We want this to be not too small so we can
  // amortize the lock overhead for accessing the central list.  Making
  // it too big may temporarily cause unnecessary memory wastage in the
  // per-thread free list until the scavenger cleans up the list.
  static const int kNumObjectsToMove = 32;
  
  // Maximum length we allow a per-thread free-list to have before we
  // move objects from it into the corresponding central free-list.  We
  // want this big to avoid locking the central free-list too often.  It
  // should not hurt to make this list somewhat big because the
  // scavenging code will shrink it down when its contents are not in use.
  static const int kMaxFreeListLength = 256;
  
  // Lower and upper bounds on the per-thread cache sizes
  static const size_t kMinThreadCacheSize = kMaxSize * 2;
  static const size_t kMaxThreadCacheSize = 2 << 20;
  
  // Default bound on the total amount of thread caches
  static const size_t kDefaultOverallThreadCacheSize = 16 << 20;
  
  // For all span-lengths < kMaxPages we keep an exact-size list.
  // REQUIRED: kMaxPages >= kMinSystemAlloc;
  static const size_t kMaxPages = kMinSystemAlloc;
  
  // Twice the approximate gap between sampling actions.
  // I.e., we take one sample approximately once every
  //      kSampleParameter/2
  // bytes of allocation, i.e., ~ once every 128KB.
  // Must be a prime number.
  static const size_t kSampleParameter = 266053;
  
  //-------------------------------------------------------------------
  // Mapping from size to size_class and vice versa
  //-------------------------------------------------------------------
  
  // A pair of arrays we use for implementing the mapping from a size to
  // its size class.  Indexed by "floor(lg(size))".
  static const int kSizeBits = 8 * sizeof(size_t);
  static unsigned char size_base[kSizeBits];
  static unsigned char size_shift[kSizeBits];
  
  // Mapping from size class to size
  static size_t class_to_size[kNumClasses];
  
  // Mapping from size class to number of pages to allocate at a time
  static size_t class_to_pages[kNumClasses];
  
  // Return floor(log2(n)) for n > 0.
  #if defined __i386__ && defined __GNUC__
  static inline int LgFloor(size_t n) {
    // "ro" for the input spec means the input can come from either a
    // register ("r") or offsetable memory ("o").
    int result;
    __asm__("bsrl  %1, %0"
            : "=r" (result)               // Output spec
            : "ro" (n)                    // Input spec
            : "cc"                        // Clobbers condition-codes
            );
    return result;
  }
  
  #elif defined __ppc__ && defined __GNUC__
  static inline int LgFloor(size_t n) {
    // "r" for the input spec means the input must come from a
    // register ("r")
    int result;
  
    __asm__ ("{cntlz|cntlzw} %0,%1" 
             : "=r" (result)              // Output spec
             : "r" (n));                  // Input spec
  
    return 31 - result;
  }
  
  #else
  // Note: the following only works for "n"s that fit in 32-bits, but
  // that is fine since we only use it for small sizes.
  static inline int LgFloor(size_t n) {
    int log = 0;
    for (int i = 4; i >= 0; --i) {
      int shift = (1 << i);
      size_t x = n >> shift;
      if (x != 0) {
        n = x;
        log += shift;
      }
    }
    ASSERT(n == 1);
    return log;
  }
  #endif
  
  static inline int SizeClass(size_t size) {
    if (size == 0) size = 1;
    const int lg = LgFloor(size);
    const int align = size_shift[lg];
    return static_cast<int>(size_base[lg]) + ((size-1) >> align);
  }
  
  // Get the byte-size for a specified class
  static inline size_t ByteSizeForClass(size_t cl) {
    return class_to_size[cl];
  }
  
  // Initialize the mapping arrays
  static void InitSizeClasses() {
    // Special initialization for small sizes
    for (size_t lg = 0; lg < kAlignShift; lg++) {
      size_base[lg] = 1;
      size_shift[lg] = kAlignShift;
    }
  
    size_t next_class = 1;
    int alignshift = kAlignShift;
    int last_lg = -1;
    for (size_t size = kAlignment; size <= kMaxSize; size += (1 << alignshift)) {
      int lg = LgFloor(size);
      if (lg > last_lg) {
        // Increase alignment every so often.
        //
        // Since we double the alignment every time size doubles and
        // size >= 128, this means that space wasted due to alignment is
        // at most 16/128 i.e., 12.5%.  Plus we cap the alignment at 256
        // bytes, so the space wasted as a percentage starts falling for
        // sizes > 2K.
        if ((lg >= 7) && (alignshift < 8)) {
          alignshift++;
        }
        size_base[lg] = next_class - ((size-1) >> alignshift);
        size_shift[lg] = alignshift;
      }
  
      class_to_size[next_class] = size;
      last_lg = lg;
  
      next_class++;
    }
    if (next_class >= kNumClasses) {
      MESSAGE("used up too many size classes: %d\n", next_class);
      abort();
    }
  
    // Initialize the number of pages we should allocate to split into
    // small objects for a given class.
    for (size_t cl = 1; cl < next_class; cl++) {
      // Allocate enough pages so leftover is less than 1/8 of total.
      // This bounds wasted space to at most 12.5%.
      size_t psize = kPageSize;
      const size_t s = class_to_size[cl];
      while ((psize % s) > (psize >> 3)) {
        psize += kPageSize;
      }
      class_to_pages[cl] = psize >> kPageShift;
    }
  
    // Double-check sizes just to be safe
    for (size_t size = 0; size <= kMaxSize; size++) {
      const size_t sc = SizeClass(size);
      if (sc == 0) {
        MESSAGE("Bad size class %d for %" PRIuS "\n", sc, size);
        abort();
      }
      if (sc > 1 && size <= class_to_size[sc-1]) {
        MESSAGE("Allocating unnecessarily large class %d for %" PRIuS
                "\n", sc, size);
        abort();
      }
      if (sc >= kNumClasses) {
        MESSAGE("Bad size class %d for %" PRIuS "\n", sc, size);
        abort();
      }
      const size_t s = class_to_size[sc];
      if (size > s) {
        MESSAGE("Bad size %" PRIuS " for %" PRIuS " (sc = %d)\n", s, size, sc);
        abort();
      }
      if (s == 0) {
        MESSAGE("Bad size %" PRIuS " for %" PRIuS " (sc = %d)\n", s, size, sc);
        abort();
      }
    }
  }
  
  // -------------------------------------------------------------------------
  // Simple allocator for objects of a specified type.  External locking
  // is required before accessing one of these objects.
  // -------------------------------------------------------------------------
  
  // Metadata allocator -- keeps stats about how many bytes allocated
  static uint64_t metadata_system_bytes = 0;
  static void* MetaDataAlloc(size_t bytes) {
    void* result = TCMalloc_SystemAlloc(bytes);
    if (result != NULL) {
      metadata_system_bytes += bytes;
    }
    return result;
  }
  
  template <class T>
  class PageHeapAllocator {
   private:
    // How much to allocate from system at a time
    static const int kAllocIncrement = 32 << 10;
  
    // Aligned size of T
    static const size_t kAlignedSize
    = (((sizeof(T) + kAlignment - 1) / kAlignment) * kAlignment);
  
    // Free area from which to carve new objects
    char* free_area_;
    size_t free_avail_;
  
    // Free list of already carved objects
    void* free_list_;
  
    // Number of allocated but unfreed objects
    int inuse_;
  
   public:
    void Init() {
      ASSERT(kAlignedSize <= kAllocIncrement);
      inuse_ = 0;
      free_area_ = NULL;
      free_avail_ = 0;
      free_list_ = NULL;
    }
  
    T* New() {
      // Consult free list
      void* result;
      if (free_list_ != NULL) {
        result = free_list_;
        free_list_ = *(reinterpret_cast<void**>(result));
      } else {
        if (free_avail_ < kAlignedSize) {
          // Need more room
          free_area_ = reinterpret_cast<char*>(MetaDataAlloc(kAllocIncrement));
          if (free_area_ == NULL) abort();
          free_avail_ = kAllocIncrement;
        }
        result = free_area_;
        free_area_ += kAlignedSize;
        free_avail_ -= kAlignedSize;
      }
      inuse_++;
      return reinterpret_cast<T*>(result);
    }
  
    void Delete(T* p) {
      *(reinterpret_cast<void**>(p)) = free_list_;
      free_list_ = p;
      inuse_--;
    }
  
    int inuse() const { return inuse_; }
  };
  
  // -------------------------------------------------------------------------
  // Span - a contiguous run of pages
  // -------------------------------------------------------------------------
  
  // Type that can hold a page number
  typedef uintptr_t PageID;
  
  // Type that can hold the length of a run of pages
  typedef uintptr_t Length;
  
  // Convert byte size into pages
  static inline Length pages(size_t bytes) {
    return ((bytes + kPageSize - 1) >> kPageShift);
  }
  
  // Convert a user size into the number of bytes that will actually be
  // allocated
  static size_t AllocationSize(size_t bytes) {
    if (bytes > kMaxSize) {
      // Large object: we allocate an integral number of pages
      return pages(bytes) << kPageShift;
    } else {
      // Small object: find the size class to which it belongs
      return ByteSizeForClass(SizeClass(bytes));
    }
  }
  
  // Information kept for a span (a contiguous run of pages).
  struct Span {
    PageID        start;          // Starting page number
    Length        length;         // Number of pages in span
    Span*         next;           // Used when in link list
    Span*         prev;           // Used when in link list
    void*         objects;        // Linked list of free objects
    unsigned int  free : 1;       // Is the span free
    unsigned int  sample : 1;     // Sampled object?
    unsigned int  sizeclass : 8;  // Size-class for small objects (or 0)
    unsigned int  refcount : 11;  // Number of non-free objects
  
  #undef SPAN_HISTORY
  #ifdef SPAN_HISTORY
    // For debugging, we can keep a log events per span
    int nexthistory;
    char history[64];
    int value[64];
  #endif
  };
  
  #ifdef SPAN_HISTORY
  void Event(Span* span, char op, int v = 0) {
    span->history[span->nexthistory] = op;
    span->value[span->nexthistory] = v;
    span->nexthistory++;
    if (span->nexthistory == sizeof(span->history)) span->nexthistory = 0;
  }
  #else
  #define Event(s,o,v) ((void) 0)
  #endif
  
  // Allocator/deallocator for spans
  static PageHeapAllocator<Span> span_allocator;
  static Span* NewSpan(PageID p, Length len) {
    Span* result = span_allocator.New();
    memset(result, 0, sizeof(*result));
    result->start = p;
    result->length = len;
  #ifdef SPAN_HISTORY
    result->nexthistory = 0;
  #endif
    return result;
  }
  
  static inline void DeleteSpan(Span* span) {
  #ifndef NDEBUG
    // In debug mode, trash the contents of deleted Spans
    memset(span, 0x3f, sizeof(*span));
  #endif
    span_allocator.Delete(span);
  }
  
  // -------------------------------------------------------------------------
  // Doubly linked list of spans.
  // -------------------------------------------------------------------------
  
  static inline void DLL_Init(Span* list) {
    list->next = list;
    list->prev = list;
  }
  
  static inline void DLL_Remove(Span* span) {
    span->prev->next = span->next;
    span->next->prev = span->prev;
    span->prev = NULL;
    span->next = NULL;
  }
  
  static inline bool DLL_IsEmpty(const Span* list) {
    return list->next == list;
  }
  
  #ifndef KXC_CHANGES
  static int DLL_Length(const Span* list) {
    int result = 0;
    for (Span* s = list->next; s != list; s = s->next) {
      result++;
    }
    return result;
  }
  #endif
  
  #if 0 /* Not needed at the moment -- causes compiler warnings if not used */
  static void DLL_Print(const char* label, const Span* list) {
    MESSAGE("%-10s %p:", label, list);
    for (const Span* s = list->next; s != list; s = s->next) {
      MESSAGE(" <%p,%u,%u>", s, s->start, s->length);
    }
    MESSAGE("\n");
  }
  #endif
  
  static void DLL_Prepend(Span* list, Span* span) {
    ASSERT(span->next == NULL);
    ASSERT(span->prev == NULL);
    span->next = list->next;
    span->prev = list;
    list->next->prev = span;
    list->next = span;
  }
  
  static void DLL_InsertOrdered(Span* list, Span* span) {
    ASSERT(span->next == NULL);
    ASSERT(span->prev == NULL);
    // Look for appropriate place to insert
    Span* x = list;
    while ((x->next != list) && (x->next->start < span->start)) {
      x = x->next;
    }
    span->next = x->next;
    span->prev = x;
    x->next->prev = span;
    x->next = span;
  }
  
  // -------------------------------------------------------------------------
  // Stack traces kept for sampled allocations
  //   The following state is protected by pageheap_lock_.
  // -------------------------------------------------------------------------
  
  static const int kMaxStackDepth = 31;
  struct StackTrace {
    uintptr_t size;          // Size of object
    int       depth;         // Number of PC values stored in array below
    void*     stack[kMaxStackDepth];
  };
  static PageHeapAllocator<StackTrace> stacktrace_allocator;
  static Span sampled_objects;
  
  // -------------------------------------------------------------------------
  // Map from page-id to per-page data
  // -------------------------------------------------------------------------
  
  // We use PageMap2<> for 32-bit and PageMap3<> for 64-bit machines.
  
  // Selector class -- general selector uses 3-level map
  template <int BITS> class MapSelector {
   public:
    typedef TCMalloc_PageMap3<BITS-kPageShift> Type;
  };
  
  // A two-level map for 32-bit machines
  template <> class MapSelector<32> {
   public:
    typedef TCMalloc_PageMap2<32-kPageShift> Type;
  };
  
  // -------------------------------------------------------------------------
  // Page-level allocator
  //  * Eager coalescing
  //
  // Heap for page-level allocation.  We allow allocating and freeing a
  // contiguous runs of pages (called a "span").
  // -------------------------------------------------------------------------
  
  class TCMalloc_PageHeap {
   public:
    TCMalloc_PageHeap();
  
    // Allocate a run of "n" pages.  Returns zero if out of memory.
    Span* New(Length n);
  
    // Delete the span "[p, p+n-1]".
    // REQUIRES: span was returned by earlier call to New() and
    //           has not yet been deleted.
    void Delete(Span* span);
  
    // Mark an allocated span as being used for small objects of the
    // specified size-class.
    // REQUIRES: span was returned by an earlier call to New()
    //           and has not yet been deleted.
    void RegisterSizeClass(Span* span, size_t sc);
  
    // Split an allocated span into two spans: one of length "n" pages
    // followed by another span of length "span->length - n" pages.
    // Modifies "*span" to point to the first span of length "n" pages.
    // Returns a pointer to the second span.
    //
    // REQUIRES: "0 < n < span->length"
    // REQUIRES: !span->free
    // REQUIRES: span->sizeclass == 0
    Span* Split(Span* span, Length n);
  
    // Return the descriptor for the specified page.
    inline Span* GetDescriptor(PageID p) const {
      return reinterpret_cast<Span*>(pagemap_.get(p));
    }
  
    // Dump state to stderr
  #ifndef KXC_CHANGES
    void Dump(TCMalloc_Printer* out);
  #endif
  
    // Return number of bytes allocated from system
    inline uint64_t SystemBytes() const { return system_bytes_; }
  
    // Return number of free bytes in heap
    uint64_t FreeBytes() const {
      return (static_cast<uint64_t>(free_pages_) << kPageShift);
    }
  
    bool Check();
    bool CheckList(Span* list, Length min_pages, Length max_pages);
  
   private:
    // Pick the appropriate map type based on pointer size
    typedef MapSelector<8*sizeof(uintptr_t)>::Type PageMap;
    PageMap pagemap_;
  
    // List of free spans of length >= kMaxPages
    Span large_;
  
    // Array mapping from span length to a doubly linked list of free spans
    Span free_[kMaxPages];
  
    // Number of pages kept in free lists
    uintptr_t free_pages_;
  
    // Bytes allocated from system
    uint64_t system_bytes_;
  
    bool GrowHeap(Length n);
  
    // REQUIRES   span->length >= n
    // Remove span from its free list, and move any leftover part of
    // span into appropriate free lists.  Also update "span" to have
    // length exactly "n" and mark it as non-free so it can be returned
    // to the client.
    void Carve(Span* span, Length n);
  
    void RecordSpan(Span* span) {
      pagemap_.set(span->start, span);
      if (span->length > 1) {
        pagemap_.set(span->start + span->length - 1, span);
      }
    }
  };
  
  TCMalloc_PageHeap::TCMalloc_PageHeap() : pagemap_(MetaDataAlloc),
                                           free_pages_(0),
                                           system_bytes_(0) {
    DLL_Init(&large_);
    for (size_t i = 0; i < kMaxPages; i++) {
      DLL_Init(&free_[i]);
    }
  }
  
  inline Span* TCMalloc_PageHeap::New(Length n) {
    ASSERT(Check());
    if (n == 0) n = 1;
  
    // Find first size >= n that has a non-empty list
    for (size_t s = n; s < kMaxPages; s++) {
      if (!DLL_IsEmpty(&free_[s])) {
        Span* result = free_[s].next;
        Carve(result, n);
        ASSERT(Check());
        free_pages_ -= n;
        return result;
      }
    }
  
    // Look in large list.  If we first do not find something, we try to
    // grow the heap and try again.
    for (int i = 0; i < 2; i++) {
      // find the best span (closest to n in size)
      Span *best = NULL;
      for (Span* span = large_.next; span != &large_; span = span->next) {
        if (span->length >= n &&
            (best == NULL || span->length < best->length)) {
          best = span;
        }
      }
      if (best != NULL) {
        Carve(best, n);
        ASSERT(Check());
        free_pages_ -= n;
        return best;
      }
      if (i == 0) {
        // Nothing suitable in large list.  Grow the heap and look again.
        if (!GrowHeap(n)) {
          ASSERT(Check());
          return NULL;
        }
      }
    }
    return NULL;
  }
  
  Span* TCMalloc_PageHeap::Split(Span* span, Length n) {
    ASSERT(0 < n);
    ASSERT(n < span->length);
    ASSERT(!span->free);
    ASSERT(span->sizeclass == 0);
    Event(span, 'T', n);
  
    const int extra = span->length - n;
    Span* leftover = NewSpan(span->start + n, extra);
    Event(leftover, 'U', extra);
    RecordSpan(leftover);
    pagemap_.set(span->start + n - 1, span); // Update map from pageid to span
    span->length = n;
  
    return leftover;
  }
  
  inline void TCMalloc_PageHeap::Carve(Span* span, Length n) {
    ASSERT(n > 0);
    DLL_Remove(span);
    span->free = 0;
    Event(span, 'A', n);
  
    const size_t extra = span->length - n;
    ASSERT(extra >= 0);
    if (extra > 0) {
      Span* leftover = NewSpan(span->start + n, extra);
      leftover->free = 1;
      Event(leftover, 'S', extra);
      RecordSpan(leftover);
      if (extra < kMaxPages) {
        DLL_Prepend(&free_[extra], leftover);
      } else {
        DLL_InsertOrdered(&large_, leftover);
      }
      span->length = n;
      pagemap_.set(span->start + n - 1, span);
    }
  }
  
  inline void TCMalloc_PageHeap::Delete(Span* span) {
    ASSERT(Check());
    ASSERT(!span->free);
    ASSERT(span->length > 0);
    ASSERT(GetDescriptor(span->start) == span);
    ASSERT(GetDescriptor(span->start + span->length - 1) == span);
    span->sizeclass = 0;
    span->sample = 0;
  
    // Coalesce -- we guarantee that "p" != 0, so no bounds checking
    // necessary.  We do not bother resetting the stale pagemap
    // entries for the pieces we are merging together because we only
    // care about the pagemap entries for the boundaries.
    const PageID p = span->start;
    const Length n = span->length;
    Span* prev = GetDescriptor(p-1);
    if (prev != NULL && prev->free) {
      // Merge preceding span into this span
      ASSERT(prev->start + prev->length == p);
      const Length len = prev->length;
      DLL_Remove(prev);
      DeleteSpan(prev);
      span->start -= len;
      span->length += len;
      pagemap_.set(span->start, span);
      Event(span, 'L', len);
    }
    Span* next = GetDescriptor(p+n);
    if (next != NULL && next->free) {
      // Merge next span into this span
      ASSERT(next->start == p+n);
      const Length len = next->length;
      DLL_Remove(next);
      DeleteSpan(next);
      span->length += len;
      pagemap_.set(span->start + span->length - 1, span);
      Event(span, 'R', len);
    }
  
    Event(span, 'D', span->length);
    span->free = 1;
    if (span->length < kMaxPages) {
      DLL_Prepend(&free_[span->length], span);
    } else {
      DLL_InsertOrdered(&large_, span);
    }
    free_pages_ += n;
  
    ASSERT(Check());
  }
  
  void TCMalloc_PageHeap::RegisterSizeClass(Span* span, size_t sc) {
    // Associate span object with all interior pages as well
    ASSERT(!span->free);
    ASSERT(GetDescriptor(span->start) == span);
    ASSERT(GetDescriptor(span->start+span->length-1) == span);
    Event(span, 'C', sc);
    span->sizeclass = sc;
    for (Length i = 1; i < span->length-1; i++) {
      pagemap_.set(span->start+i, span);
    }
  }
  
  #ifndef KXC_CHANGES
  void TCMalloc_PageHeap::Dump(TCMalloc_Printer* out) {
    int nonempty_sizes = 0;
    for (int s = 0; s < kMaxPages; s++) {
      if (!DLL_IsEmpty(&free_[s])) nonempty_sizes++;
    }
    out->printf("------------------------------------------------\n");
    out->printf("PageHeap: %d sizes; %6.1f MB free\n", nonempty_sizes,
                (static_cast<double>(free_pages_) * kPageSize) / 1048576.0);
    out->printf("------------------------------------------------\n");
    uint64_t cumulative = 0;
    for (int s = 0; s < kMaxPages; s++) {
      if (!DLL_IsEmpty(&free_[s])) {
        const int list_length = DLL_Length(&free_[s]);
        uint64_t s_pages = s * list_length;
        cumulative += s_pages;
        out->printf("%6u pages * %6u spans ~ %6.1f MB; %6.1f MB cum\n",
                    s, list_length,
                    (s_pages << kPageShift) / 1048576.0,
                    (cumulative << kPageShift) / 1048576.0);
      }
    }
  
    uint64_t large_pages = 0;
    int large_spans = 0;
    for (Span* s = large_.next; s != &large_; s = s->next) {
      out->printf("   [ %6" PRIuS " spans ]\n", s->length);
      large_pages += s->length;
      large_spans++;
    }
    cumulative += large_pages;
    out->printf(">255   large * %6u spans ~ %6.1f MB; %6.1f MB cum\n",
                large_spans,
                (large_pages << kPageShift) / 1048576.0,
                (cumulative << kPageShift) / 1048576.0);
  }
  #endif
  
  bool TCMalloc_PageHeap::GrowHeap(Length n) {
    ASSERT(kMaxPages >= kMinSystemAlloc);
    Length ask = (n>kMinSystemAlloc) ? n : static_cast<Length>(kMinSystemAlloc);
    void* ptr = TCMalloc_SystemAlloc(ask << kPageShift, kPageSize);
    if (ptr == NULL) {
      if (n < ask) {
        // Try growing just "n" pages
        ask = n;
        ptr = TCMalloc_SystemAlloc(ask << kPageShift, kPageSize);
      }
      if (ptr == NULL) return false;
    }
    system_bytes_ += (ask << kPageShift);
    const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
    ASSERT(p > 0);
  
    // Make sure pagemap_ has entries for all of the new pages.
    // Plus ensure one before and one after so coalescing code
    // does not need bounds-checking.
    if (pagemap_.Ensure(p-1, ask+2)) {
      // Pretend the new area is allocated and then Delete() it to
      // cause any necessary coalescing to occur.
      //
      // We do not adjust free_pages_ here since Delete() will do it for us.
      Span* span = NewSpan(p, ask);
      RecordSpan(span);
      Delete(span);
      ASSERT(Check());
      return true;
    } else {
      // We could not allocate memory within "pagemap_"
      // TODO: Once we can return memory to the system, return the new span
      return false;
    }
  }
  
  bool TCMalloc_PageHeap::Check() {
    ASSERT(free_[0].next == &free_[0]);
    CheckList(&large_, kMaxPages, 1000000000);
    for (Length s = 1; s < kMaxPages; s++) {
      CheckList(&free_[s], s, s);
    }
    return true;
  }
  
  bool TCMalloc_PageHeap::CheckList(Span* list, Length min_pages, Length max_pages) {
    for (Span* s = list->next; s != list; s = s->next) {
      CHECK_CONDITION(s->free);
      CHECK_CONDITION(s->length >= min_pages);
      CHECK_CONDITION(s->length <= max_pages);
      CHECK_CONDITION(GetDescriptor(s->start) == s);
      CHECK_CONDITION(GetDescriptor(s->start+s->length-1) == s);
    }
    return true;
  }
  
  //-------------------------------------------------------------------
  // Free list
  //-------------------------------------------------------------------
  
  class TCMalloc_ThreadCache_FreeList {
   private:
    void*    list_;       // Linked list of nodes
    uint16_t length_;     // Current length
    uint16_t lowater_;    // Low water mark for list length
  
   public:
    void Init() {
      list_ = NULL;
      length_ = 0;
      lowater_ = 0;
    }
  
    // Return current length of list
    int length() const {
      return length_;
    }
  
    // Is list empty?
    bool empty() const {
      return list_ == NULL;
    }
  
    // Low-water mark management
    int lowwatermark() const { return lowater_; }
    void clear_lowwatermark() { lowater_ = length_; }
  
    void Push(void* ptr) {
      *(reinterpret_cast<void**>(ptr)) = list_;
      list_ = ptr;
      length_++;
    }
  
    void* Pop() {
      ASSERT(list_ != NULL);
      void* result = list_;
      list_ = *(reinterpret_cast<void**>(result));
      length_--;
      if (length_ < lowater_) lowater_ = length_;
      return result;
    }
  };
  
  //-------------------------------------------------------------------
  // Data kept per thread
  //-------------------------------------------------------------------
  
  class TCMalloc_ThreadCache {
   private:
    typedef TCMalloc_ThreadCache_FreeList FreeList;
  
    size_t        size_;                  // Combined size of data
    pthread_t     tid_;                   // Which thread owns it
    bool          setspecific_;           // Called pthread_setspecific?
    FreeList      list_[kNumClasses];     // Array indexed by size-class
  
    // We sample allocations, biased by the size of the allocation
    uint32_t      rnd_;                   // Cheap random number generator
    size_t        bytes_until_sample_;    // Bytes until we sample next
  
   public:
    // All ThreadCache objects are kept in a linked list (for stats collection)
    TCMalloc_ThreadCache* next_;
    TCMalloc_ThreadCache* prev_;
  
    void Init(pthread_t tid);
    void Cleanup();
  
    // Accessors (mostly just for printing stats)
    int freelist_length(size_t cl) const { return list_[cl].length(); }
  
    // Total byte size in cache
    size_t Size() const { return size_; }
  
    void* Allocate(size_t size);
    void Deallocate(void* ptr, size_t size_class);
  
    void FetchFromCentralCache(size_t cl);
    void ReleaseToCentralCache(size_t cl, int N);
    void Scavenge();
    void Print() const;
  
    // Record allocation of "k" bytes.  Return true iff allocation
    // should be sampled
    bool SampleAllocation(size_t k);
  
    // Pick next sampling point
    void PickNextSample();
  
    static void                  InitModule();
    static void                  InitTSD();
    static TCMalloc_ThreadCache* GetCache();
    static TCMalloc_ThreadCache* GetCacheIfPresent();
    static void*                 CreateCacheIfNecessary();
    static void                  DeleteCache(void* ptr);
    static void                  RecomputeThreadCacheSize();
  };
  
  //-------------------------------------------------------------------
  // Data kept per size-class in central cache
  //-------------------------------------------------------------------
  
  class TCMalloc_Central_FreeList {
   public:
    void Init(size_t cl);
  
    // REQUIRES: lock_ is held
    // Insert object.
    // May temporarily release lock_.
    void Insert(void* object);
  
    // REQUIRES: lock_ is held
    // Remove object from cache and return.
    // Return NULL if no free entries in cache.
    void* Remove();
  
    // REQUIRES: lock_ is held
    // Populate cache by fetching from the page heap.
    // May temporarily release lock_.
    void Populate();
  
    // REQUIRES: lock_ is held
    // Number of free objects in cache
    int length() const { return counter_; }
  
    // Lock -- exposed because caller grabs it before touching this object
    SpinLock lock_;
  
   private:
    // We keep linked lists of empty and non-emoty spans.
    size_t   size_class_;     // My size class
    Span     empty_;          // Dummy header for list of empty spans
    Span     nonempty_;       // Dummy header for list of non-empty spans
    size_t   counter_;        // Number of free objects in cache entry
  };
  
  // Pad each CentralCache object to multiple of 64 bytes
  class TCMalloc_Central_FreeListPadded : public TCMalloc_Central_FreeList {
   private:
    char pad_[(64 - (sizeof(TCMalloc_Central_FreeList) % 64)) % 64];
  };
  
  //-------------------------------------------------------------------
  // Global variables
  //-------------------------------------------------------------------
  
  // Central cache -- a collection of free-lists, one per size-class.
  // We have a separate lock per free-list to reduce contention.
  static TCMalloc_Central_FreeListPadded central_cache[kNumClasses];
  
  // Page-level allocator
  static SpinLock pageheap_lock = SPINLOCK_INITIALIZER;
  static char pageheap_memory[sizeof(TCMalloc_PageHeap)];
  static bool phinited = false;
  
  // Avoid extra level of indirection by making "pageheap" be just an alias
  // of pageheap_memory.
  #define pageheap ((TCMalloc_PageHeap*) pageheap_memory)
  
  // Thread-specific key.  Initialization here is somewhat tricky
  // because some Linux startup code invokes malloc() before it
  // is in a good enough state to handle pthread_keycreate().
  // Therefore, we use TSD keys only after tsd_inited is set to true.
  // Until then, we use a slow path to get the heap object.
  static bool tsd_inited = false;
  static pthread_key_t heap_key;
  
  // Allocator for thread heaps
  static PageHeapAllocator<TCMalloc_ThreadCache> threadheap_allocator;
  
  // Linked list of heap objects.  Protected by pageheap_lock.
  static TCMalloc_ThreadCache* thread_heaps = NULL;
  static int thread_heap_count = 0;
  
  // Overall thread cache size.  Protected by pageheap_lock.
  static size_t overall_thread_cache_size = kDefaultOverallThreadCacheSize;
  
  // Global per-thread cache size.  Writes are protected by
  // pageheap_lock.  Reads are done without any locking, which should be
  // fine as long as size_t can be written atomically and we don't place
  // invariants between this variable and other pieces of state.
  static volatile size_t per_thread_cache_size = kMaxThreadCacheSize;
  
  //-------------------------------------------------------------------
  // Central cache implementation
  //-------------------------------------------------------------------
  
  void TCMalloc_Central_FreeList::Init(size_t cl) {
    lock_.Init();
    size_class_ = cl;
    DLL_Init(&empty_);
    DLL_Init(&nonempty_);
    counter_ = 0;
  }
  
  inline void TCMalloc_Central_FreeList::Insert(void* object) {
    const PageID p = reinterpret_cast<uintptr_t>(object) >> kPageShift;
    Span* span = pageheap->GetDescriptor(p);
    ASSERT(span != NULL);
    ASSERT(span->refcount > 0);
  
    // If span is empty, move it to non-empty list
    if (span->objects == NULL) {
      DLL_Remove(span);
      DLL_Prepend(&nonempty_, span);
      Event(span, 'N', 0);
    }
  
    // The following check is expensive, so it is disabled by default
    if (false) {
      // Check that object does not occur in list
      int got = 0;
      for (void* p = span->objects; p != NULL; p = *((void**) p)) {
        ASSERT(p != object);
        got++;
      }
      ASSERT(got + span->refcount ==
             (span->length<<kPageShift)/ByteSizeForClass(span->sizeclass));
    }
  
    counter_++;
    span->refcount--;
    if (span->refcount == 0) {
      Event(span, '#', 0);
      counter_ -= (span->length<<kPageShift) / ByteSizeForClass(span->sizeclass);
      DLL_Remove(span);
  
      // Release central list lock while operating on pageheap
      lock_.Unlock();
      {
        SpinLockHolder h(&pageheap_lock);
        pageheap->Delete(span);
      }
      lock_.Lock();
    } else {
      *(reinterpret_cast<void**>(object)) = span->objects;
      span->objects = object;
    }
  }
  
  inline void* TCMalloc_Central_FreeList::Remove() {
    if (DLL_IsEmpty(&nonempty_)) return NULL;
    Span* span = nonempty_.next;
  
    ASSERT(span->objects != NULL);
    span->refcount++;
    void* result = span->objects;
    span->objects = *(reinterpret_cast<void**>(result));
    if (span->objects == NULL) {
      // Move to empty list
      DLL_Remove(span);
      DLL_Prepend(&empty_, span);
      Event(span, 'E', 0);
    }
    counter_--;
    return result;
  }
  
  // Fetch memory from the system and add to the central cache freelist.
  inline void TCMalloc_Central_FreeList::Populate() {
    // Release central list lock while operating on pageheap
    lock_.Unlock();
    const size_t npages = class_to_pages[size_class_];
  
    Span* span;
    {
      SpinLockHolder h(&pageheap_lock);
      span = pageheap->New(npages);
      if (span) pageheap->RegisterSizeClass(span, size_class_);
    }
    if (span == NULL) {
      MESSAGE("allocation failed: %d\n", errno);
      lock_.Lock();
      return;
    }
  
    // Split the block into pieces and add to the free-list
    // TODO: coloring of objects to avoid cache conflicts?
    void** tail = &span->objects;
    char* ptr = reinterpret_cast<char*>(span->start << kPageShift);
    char* limit = ptr + (npages << kPageShift);
    const size_t size = ByteSizeForClass(size_class_);
    int num = 0;
    while (ptr + size <= limit) {
      *tail = ptr;
      tail = reinterpret_cast<void**>(ptr);
      ptr += size;
      num++;
    }
    ASSERT(ptr <= limit);
    *tail = NULL;
    span->refcount = 0; // No sub-object in use yet
  
    // Add span to list of non-empty spans
    lock_.Lock();
    DLL_Prepend(&nonempty_, span);
    counter_ += num;
  }
  
  //-------------------------------------------------------------------
  // TCMalloc_ThreadCache implementation
  //-------------------------------------------------------------------
  
  inline bool TCMalloc_ThreadCache::SampleAllocation(size_t k) {
    if (bytes_until_sample_ < k) {
      PickNextSample();
      return true;
    } else {
      bytes_until_sample_ -= k;
      return false;
    }
  }
  
  void TCMalloc_ThreadCache::Init(pthread_t tid) {
    size_ = 0;
    next_ = NULL;
    prev_ = NULL;
    tid_  = tid;
    setspecific_ = false;
    for (size_t cl = 0; cl < kNumClasses; ++cl) {
      list_[cl].Init();
    }
  
    // Initialize RNG -- run it for a bit to get to good values
    rnd_ = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this));
    for (int i = 0; i < 100; i++) {
      PickNextSample();
    }
  }
  
  void TCMalloc_ThreadCache::Cleanup() {
    // Put unused memory back into central cache
    for (size_t cl = 0; cl < kNumClasses; ++cl) {
      FreeList* src = &list_[cl];
      TCMalloc_Central_FreeList* dst = &central_cache[cl];
      SpinLockHolder h(&dst->lock_);
      while (!src->empty()) {
        dst->Insert(src->Pop());
      }
    }
  }
  
  inline void* TCMalloc_ThreadCache::Allocate(size_t size) {
    ASSERT(size <= kMaxSize);
    const size_t cl = SizeClass(size);
    FreeList* list = &list_[cl];
    if (list->empty()) {
      FetchFromCentralCache(cl);
      if (list->empty()) return NULL;
    }
    size_ -= ByteSizeForClass(cl);
    return list->Pop();
  }
  
  inline void TCMalloc_ThreadCache::Deallocate(void* ptr, size_t cl) {
    size_ += ByteSizeForClass(cl);
    FreeList* list = &list_[cl];
    list->Push(ptr);
    // If enough data is free, put back into central cache
    if (list->length() > kMaxFreeListLength) {
      ReleaseToCentralCache(cl, kNumObjectsToMove);
    }
    if (size_ >= per_thread_cache_size) Scavenge();
  }
  
  // Remove some objects of class "cl" from central cache and add to thread heap
  inline void TCMalloc_ThreadCache::FetchFromCentralCache(size_t cl) {
    TCMalloc_Central_FreeList* src = &central_cache[cl];
    FreeList* dst = &list_[cl];
    SpinLockHolder h(&src->lock_);
    for (int i = 0; i < kNumObjectsToMove; i++) {
      void* object = src->Remove();
     if (object == NULL) {
        if (i == 0) {
          src->Populate();        // Temporarily releases src->lock_
          object = src->Remove();
       }
        if (object == NULL) {
          break;
        }
      }
      dst->Push(object);
      size_ += ByteSizeForClass(cl);
    }
  }
  
  // Remove some objects of class "cl" from thread heap and add to central cache
  inline void TCMalloc_ThreadCache::ReleaseToCentralCache(size_t cl, int N) {
    FreeList* src = &list_[cl];
    TCMalloc_Central_FreeList* dst = &central_cache[cl];
    SpinLockHolder h(&dst->lock_);
    if (N > src->length()) N = src->length();
    size_ -= N*ByteSizeForClass(cl);
    while (N-- > 0) {
      void* ptr = src->Pop();
      dst->Insert(ptr);
    }
  }
  
  // Release idle memory to the central cache
  inline void TCMalloc_ThreadCache::Scavenge() {
    // If the low-water mark for the free list is L, it means we would
    // not have had to allocate anything from the central cache even if
    // we had reduced the free list size by L.  We aim to get closer to
    // that situation by dropping L/2 nodes from the free list.  This
    // may not release much memory, but if so we will call scavenge again
    // pretty soon and the low-water marks will be high on that call.
  #ifndef KXC_CHANGES
    int64 start = CycleClock::Now();
  #endif
  
    for (size_t cl = 0; cl < kNumClasses; cl++) {
      FreeList* list = &list_[cl];
      const int lowmark = list->lowwatermark();
      if (lowmark > 0) {
        const int drop = (lowmark > 1) ? lowmark/2 : 1;
        ReleaseToCentralCache(cl, drop);
      }
      list->clear_lowwatermark();
    }
  
  #ifndef KXC_CHANGES
    int64 finish = CycleClock::Now();
    CycleTimer ct;
    MESSAGE("GC: %.0f ns\n", ct.CyclesToUsec(finish-start)*1000.0);
  #endif
  }
  
  inline TCMalloc_ThreadCache* TCMalloc_ThreadCache::GetCache() {
    void* ptr = NULL;
    if (!tsd_inited) {
      InitModule();
    } else {
      ptr = pthread_getspecific(heap_key);
    }
    if (ptr == NULL) ptr = CreateCacheIfNecessary();
    return reinterpret_cast<TCMalloc_ThreadCache*>(ptr);
  }
  
  // In deletion paths, we do not try to create a thread-cache.  This is
  // because we may be in the thread destruction code and may have
  // already cleaned up the cache for this thread.
  inline TCMalloc_ThreadCache* TCMalloc_ThreadCache::GetCacheIfPresent() {
    if (!tsd_inited) return NULL;
    return reinterpret_cast<TCMalloc_ThreadCache*>
      (pthread_getspecific(heap_key));
  }
  
  void TCMalloc_ThreadCache::PickNextSample() {
    // Make next "random" number
    // x^32+x^22+x^2+x^1+1 is a primitive polynomial for random numbers
    static const uint32_t kPoly = (1 << 22) | (1 << 2) | (1 << 1) | (1 << 0);
    uint32_t r = rnd_;
    rnd_ = (r << 1) ^ ((static_cast<int32_t>(r) >> 31) & kPoly);
  
    // Next point is "rnd_ % (2*sample_period)".  I.e., average
    // increment is "sample_period".
    bytes_until_sample_ = rnd_ % kSampleParameter;
  }
  
  void TCMalloc_ThreadCache::InitModule() {
    // There is a slight potential race here because of double-checked
    // locking idiom.  However, as long as the program does a small
    // allocation before switching to multi-threaded mode, we will be
    // fine.  We increase the chances of doing such a small allocation
    // by doing one in the constructor of the module_enter_exit_hook
    // object declared below.
    SpinLockHolder h(&pageheap_lock);
    if (!phinited) {
      InitSizeClasses();
      threadheap_allocator.Init();
      span_allocator.Init();
      span_allocator.New(); // Reduce cache conflicts
      span_allocator.New(); // Reduce cache conflicts
      stacktrace_allocator.Init();
      DLL_Init(&sampled_objects);
      for (size_t i = 0; i < kNumClasses; ++i) {
        central_cache[i].Init(i);
      }
      new ((void*)pageheap_memory) TCMalloc_PageHeap;
      phinited = 1;
    }
  }
  
  void TCMalloc_ThreadCache::InitTSD() {
    ASSERT(!tsd_inited);
    pthread_key_create(&heap_key, DeleteCache);
    tsd_inited = true;
      
    // We may have used a fake pthread_t for the main thread.  Fix it.
    pthread_t zero;
    memset(&zero, 0, sizeof(zero));
    SpinLockHolder h(&pageheap_lock);
    for (TCMalloc_ThreadCache* h = thread_heaps; h != NULL; h = h->next_) {
      if (h->tid_ == zero) {
        h->tid_ = pthread_self();
      }
    }
  }
  
  void* TCMalloc_ThreadCache::CreateCacheIfNecessary() {
    // Initialize per-thread data if necessary
    TCMalloc_ThreadCache* heap = NULL;
    {
      SpinLockHolder h(&pageheap_lock);
  
      // Early on in glibc's life, we cannot even call pthread_self()
      pthread_t me;
      if (!tsd_inited) {
        memset(&me, 0, sizeof(me));
      } else {
        me = pthread_self();
      }
  
      // This may be a recursive malloc call from pthread_setspecific()
      // In that case, the heap for this thread has already been created
      // and added to the linked list.  So we search for that first.
      for (TCMalloc_ThreadCache* h = thread_heaps; h != NULL; h = h->next_) {
        if (h->tid_ == me) {
          heap = h;
          break;
        }
      }
  
      if (heap == NULL) {
        // Create the heap and add it to the linked list
        heap = threadheap_allocator.New();
        heap->Init(me);
        heap->next_ = thread_heaps;
        heap->prev_ = NULL;
        if (thread_heaps != NULL) thread_heaps->prev_ = heap;
        thread_heaps = heap;
        thread_heap_count++;
        RecomputeThreadCacheSize();
      }
    }
  
    // We call pthread_setspecific() outside the lock because it may
    // call malloc() recursively.  The recursive call will never get
    // here again because it will find the already allocated heap in the
    // linked list of heaps.
    if (!heap->setspecific_ && tsd_inited) {
      heap->setspecific_ = true;
      pthread_setspecific(heap_key, heap);
    }
    return heap;
  }
  
  void TCMalloc_ThreadCache::DeleteCache(void* ptr) {
    // Remove all memory from heap
    TCMalloc_ThreadCache* heap;
    heap = reinterpret_cast<TCMalloc_ThreadCache*>(ptr);
    heap->Cleanup();
  
    // Remove from linked list
    SpinLockHolder h(&pageheap_lock);
    if (heap->next_ != NULL) heap->next_->prev_ = heap->prev_;
    if (heap->prev_ != NULL) heap->prev_->next_ = heap->next_;
    if (thread_heaps == heap) thread_heaps = heap->next_;
    thread_heap_count--;
    RecomputeThreadCacheSize();
  
    threadheap_allocator.Delete(heap);
  }
  
  void TCMalloc_ThreadCache::RecomputeThreadCacheSize() {
    // Divide available space across threads
    int n = thread_heap_count > 0 ? thread_heap_count : 1;
    size_t space = overall_thread_cache_size / n;
  
    // Limit to allowed range
    if (space < kMinThreadCacheSize) space = kMinThreadCacheSize;
    if (space > kMaxThreadCacheSize) space = kMaxThreadCacheSize;
  
    per_thread_cache_size = space;
  }
  
  void TCMalloc_ThreadCache::Print() const {
    for (size_t cl = 0; cl < kNumClasses; ++cl) {
      MESSAGE("      %5" PRIuS " : %4d len; %4d lo\n",
              ByteSizeForClass(cl),
              list_[cl].length(),
              list_[cl].lowwatermark());
    }
  }
  
  // Extract interesting stats
  struct TCMallocStats {
    uint64_t system_bytes;        // Bytes alloced from system
    uint64_t thread_bytes;        // Bytes in thread caches
    uint64_t central_bytes;       // Bytes in central cache
    uint64_t pageheap_bytes;      // Bytes in page heap
    uint64_t metadata_bytes;      // Bytes alloced for metadata
  };
  
  #ifndef KXC_CHANGES
  // Get stats into "r".  Also get per-size-class counts if class_count != NULL
  static void ExtractStats(TCMallocStats* r, uint64_t* class_count) {
    r->central_bytes = 0;
    for (size_t cl = 0; cl < kNumClasses; ++cl) {
      SpinLockHolder h(&central_cache[cl].lock_);
      const int length = central_cache[cl].length();
      r->central_bytes += static_cast<uint64_t>(ByteSizeForClass(cl)) * length;
      if (class_count) class_count[cl] = length;
    }
  
    // Add stats from per-thread heaps
    r->thread_bytes = 0;
    { // scope
      SpinLockHolder h(&pageheap_lock);
      for (TCMalloc_ThreadCache* h = thread_heaps; h != NULL; h = h->next_) {
        r->thread_bytes += h->Size();
        if (class_count) {
          for (size_t cl = 0; cl < kNumClasses; ++cl) {
            class_count[cl] += h->freelist_length(cl);
          }
        }
      }
    }
  
    { //scope
      SpinLockHolder h(&pageheap_lock);
      r->system_bytes = pageheap->SystemBytes();
      r->metadata_bytes = metadata_system_bytes;
      r->pageheap_bytes = pageheap->FreeBytes();
    }
  }
  #endif
  
  #ifndef KXC_CHANGES
  // WRITE stats to "out"
  static void DumpStats(TCMalloc_Printer* out, int level) {
    TCMallocStats stats;
    uint64_t class_count[kNumClasses];
    ExtractStats(&stats, (level >= 2 ? class_count : NULL));
  
    if (level >= 2) {
      out->printf("------------------------------------------------\n");
      uint64_t cumulative = 0;
      for (int cl = 0; cl < kNumClasses; ++cl) {
        if (class_count[cl] > 0) {
          uint64_t class_bytes = class_count[cl] * ByteSizeForClass(cl);
          cumulative += class_bytes;
          out->printf("class %3d [ %8" PRIuS " bytes ] : "
                  "%8" LLU " objs; %5.1f MB; %5.1f cum MB\n",
                  cl, ByteSizeForClass(cl),
                  class_count[cl],
                  class_bytes / 1048576.0,
                  cumulative / 1048576.0);
        }
      }
  
      SpinLockHolder h(&pageheap_lock);
      pageheap->Dump(out);
    }
  
    const uint64_t bytes_in_use = stats.system_bytes
                                  - stats.pageheap_bytes
                                  - stats.central_bytes
                                  - stats.thread_bytes;
  
    out->printf("------------------------------------------------\n"
                "MALLOC: %12" LLU " Heap size\n"
                "MALLOC: %12" LLU " Bytes in use by application\n"
                "MALLOC: %12" LLU " Bytes free in page heap\n"
                "MALLOC: %12" LLU " Bytes free in central cache\n"
                "MALLOC: %12" LLU " Bytes free in thread caches\n"
                "MALLOC: %12" LLU " Spans in use\n"
                "MALLOC: %12" LLU " Thread heaps in use\n"
                "MALLOC: %12" LLU " Metadata allocated\n"
                "------------------------------------------------\n",
                stats.system_bytes,
                bytes_in_use,
                stats.pageheap_bytes,
                stats.central_bytes,
                stats.thread_bytes,
                uint64_t(span_allocator.inuse()),
                uint64_t(threadheap_allocator.inuse()),
                stats.metadata_bytes);
  }
  
  static void PrintStats(int level) {
    const int kBufferSize = 16 << 10;
    char* buffer = new char[kBufferSize];
    TCMalloc_Printer printer(buffer, kBufferSize);
    DumpStats(&printer, level);
    write(STDERR_FILENO, buffer, strlen(buffer));
    delete[] buffer;
  }
  
  static void** DumpStackTraces() {
    // Count how much space we need
    int needed_slots = 0;
    {
      SpinLockHolder h(&pageheap_lock);
      for (Span* s = sampled_objects.next; s != &sampled_objects; s = s->next) {
        StackTrace* stack = reinterpret_cast<StackTrace*>(s->objects);
        needed_slots += 3 + stack->depth;
      }
      needed_slots += 100;            // Slop in case sample grows
      needed_slots += needed_slots/8; // An extra 12.5% slop
    }
  
    void** result = new void*[needed_slots];
    if (result == NULL) {
      MESSAGE("tcmalloc: could not allocate %d slots for stack traces\n",
              needed_slots);
      return NULL;
    }
  
    SpinLockHolder h(&pageheap_lock);
    int used_slots = 0;
    for (Span* s = sampled_objects.next; s != &sampled_objects; s = s->next) {
      ASSERT(used_slots < needed_slots);  // Need to leave room for terminator
      StackTrace* stack = reinterpret_cast<StackTrace*>(s->objects);
      if (used_slots + 3 + stack->depth >= needed_slots) {
        // No more room
        break;
      }
  
      result[used_slots+0] = reinterpret_cast<void*>(1);
      result[used_slots+1] = reinterpret_cast<void*>(stack->size);
      result[used_slots+2] = reinterpret_cast<void*>(stack->depth);
      for (int d = 0; d < stack->depth; d++) {
        result[used_slots+3+d] = stack->stack[d];
      }
      used_slots += 3 + stack->depth;
    }
    result[used_slots] = reinterpret_cast<void*>(0);
    return result;
  }
  #endif
  
  #ifndef KXC_CHANGES
  
  // TCMalloc's support for extra malloc interfaces
  class TCMallocImplementation : public MallocExtension {
   public:
    virtual void GetStats(char* buffer, int buffer_length) {
      ASSERT(buffer_length > 0);
      TCMalloc_Printer printer(buffer, buffer_length);
  
      // Print level one stats unless lots of space is available
      if (buffer_length < 10000) {
        DumpStats(&printer, 1);
      } else {
        DumpStats(&printer, 2);
      }
    }
  
    virtual void** ReadStackTraces() {
      return DumpStackTraces();
    }
  
    virtual bool GetNumericProperty(const char* name, size_t* value) {
      ASSERT(name != NULL);
  
      if (strcmp(name, "generic.current_allocated_bytes") == 0) {
        TCMallocStats stats;
        ExtractStats(&stats, NULL);
        *value = stats.system_bytes
                 - stats.thread_bytes
                 - stats.central_bytes
                 - stats.pageheap_bytes;
        return true;
      }
  
      if (strcmp(name, "generic.heap_size") == 0) {
        TCMallocStats stats;
        ExtractStats(&stats, NULL);
        *value = stats.system_bytes;
        return true;
      }
  
      if (strcmp(name, "tcmalloc.slack_bytes") == 0) {
        // We assume that bytes in the page heap are not fragmented too
        // badly, and are therefore available for allocation.
        SpinLockHolder l(&pageheap_lock);
        *value = pageheap->FreeBytes();
        return true;
      }
  
      if (strcmp(name, "tcmalloc.max_total_thread_cache_bytes") == 0) {
        SpinLockHolder l(&pageheap_lock);
        *value = overall_thread_cache_size;
        return true;
      }
  
      if (strcmp(name, "tcmalloc.current_total_thread_cache_bytes") == 0) {
        TCMallocStats stats;
        ExtractStats(&stats, NULL);
        *value = stats.thread_bytes;
        return true;
      }
  
      return false;
    }
  
    virtual bool SetNumericProperty(const char* name, size_t value) {
      ASSERT(name != NULL);
  
      if (strcmp(name, "tcmalloc.max_total_thread_cache_bytes") == 0) {
        // Clip the value to a reasonable range
        if (value < kMinThreadCacheSize) value = kMinThreadCacheSize;
        if (value > (1<<30)) value = (1<<30);     // Limit to 1GB
  
        SpinLockHolder l(&pageheap_lock);
        overall_thread_cache_size = static_cast<size_t>(value);
        TCMalloc_ThreadCache::RecomputeThreadCacheSize();
        return true;
      }
  
      return false;
    }
  };
  #endif
  
  // RedHat 9's pthread manager allocates an object directly by calling
  // a __libc_XXX() routine.  This memory block is not known to tcmalloc.
  // At cleanup time, the pthread manager calls free() on this
  // pointer, which then crashes.
  //
  // We hack around this problem by disabling all deallocations
  // after a global object destructor in this module has been called.
  #ifndef KXC_CHANGES
  static bool tcmalloc_is_destroyed = false;
  #endif
  
  //-------------------------------------------------------------------
  // Helpers for the exported routines below
  //-------------------------------------------------------------------
  
  #ifndef KXC_CHANGES
  
  static Span* DoSampledAllocation(size_t size) {
    SpinLockHolder h(&pageheap_lock);
  
    // Allocate span
    Span* span = pageheap->New(pages(size == 0 ? 1 : size));
    if (span == NULL) {
      return NULL;
    }
  
    // Allocate stack trace
    StackTrace* stack = stacktrace_allocator.New();
    if (stack == NULL) {
      // Sampling failed because of lack of memory
      return span;
    }
  
    // Fill stack trace and record properly
    stack->depth = GetStackTrace(stack->stack, kMaxStackDepth, 2);
    stack->size = size;
    span->sample = 1;
    span->objects = stack;
    DLL_Prepend(&sampled_objects, span);
  
    return span;
  }
  #endif
  
  static inline void* do_malloc(size_t size) {
  
  #ifndef KXC_CHANGES
    if (TCMallocDebug::level >= TCMallocDebug::kVerbose) 
      MESSAGE("In tcmalloc do_malloc(%" PRIuS")\n", size);
  #endif
  
    // The following call forces module initialization
    TCMalloc_ThreadCache* heap = TCMalloc_ThreadCache::GetCache();
  #ifndef KXC_CHANGES
    if (heap->SampleAllocation(size)) {
      Span* span = DoSampledAllocation(size);
      if (span == NULL) return NULL;
      return reinterpret_cast<void*>(span->start << kPageShift);
    } else
  #endif
        if (size > kMaxSize) {
      // Use page-level allocator
      SpinLockHolder h(&pageheap_lock);
      Span* span = pageheap->New(pages(size));
      if (span == NULL) return NULL;
      return reinterpret_cast<void*>(span->start << kPageShift);
    } else {
      return heap->Allocate(size);
    }
  }
  
  static inline void do_free(void* ptr) {
  #ifndef KXC_CHANGES
    if (TCMallocDebug::level >= TCMallocDebug::kVerbose) 
      MESSAGE("In tcmalloc do_free(%p)\n", ptr);
  #endif
  #if KXC_CHANGES
    if (ptr == NULL) return; 
  #else
    if (ptr == NULL || tcmalloc_is_destroyed) return;
  #endif
  
    ASSERT(pageheap != NULL);  // Should not call free() before malloc()
    const PageID p = reinterpret_cast<uintptr_t>(ptr) >> kPageShift;
    Span* span = pageheap->GetDescriptor(p);
  
  #ifndef KXC_CHANGES
    if (span == NULL) {
      // We've seen systems where a piece of memory allocated using the
      // allocator built in to libc is deallocated using free() and
      // therefore ends up inside tcmalloc which can't find the
      // corresponding span.  We silently throw this object on the floor
      // instead of crashing.
      MESSAGE("tcmalloc: ignoring potential glibc-2.3.5 induced free "
              "of an unknown object %p\n", ptr);
      return;
    }
  #endif
  
    ASSERT(span != NULL);
    ASSERT(!span->free);
    const size_t cl = span->sizeclass;
    if (cl != 0) {
      ASSERT(!span->sample);
      TCMalloc_ThreadCache* heap = TCMalloc_ThreadCache::GetCacheIfPresent();
      if (heap != NULL) {
        heap->Deallocate(ptr, cl);
      } else {
        // Delete directly into central cache
        SpinLockHolder h(&central_cache[cl].lock_);
        central_cache[cl].Insert(ptr);
      }
    } else {
      SpinLockHolder h(&pageheap_lock);
      ASSERT(reinterpret_cast<uintptr_t>(ptr) % kPageSize == 0);
      ASSERT(span->start == p);
      if (span->sample) {
        DLL_Remove(span);
        stacktrace_allocator.Delete(reinterpret_cast<StackTrace*>(span->objects));
        span->objects = NULL;
      }
      pageheap->Delete(span);
    }
  }
  
  #ifndef KXC_CHANGES
  // For use by exported routines below that want specific alignments
  //
  // Note: this code can be slow, and can significantly fragment memory.
  // The expectation is that memalign/posix_memalign/valloc/pvalloc will
  // not be invoked very often.  This requirement simplifies our
  // implementation and allows us to tune for expected allocation
  // patterns.
  static void* do_memalign(size_t align, size_t size) {
    ASSERT((align & (align - 1)) == 0);
    ASSERT(align > 0);
    if (pageheap == NULL) TCMalloc_ThreadCache::InitModule();
  
    // Allocate at least one byte to avoid boundary conditions below
    if (size == 0) size = 1;
  
    if (size <= kMaxSize && align < kPageSize) {
      // Search through acceptable size classes looking for one with
      // enough alignment.  This depends on the fact that
      // InitSizeClasses() currently produces several size classes that
      // are aligned at powers of two.  We will waste time and space if
      // we miss in the size class array, but that is deemed acceptable
      // since memalign() should be used rarely.
      size_t cl = SizeClass(size);
      while (cl < kNumClasses && ((class_to_size[cl] & (align - 1)) != 0)) {
        cl++;
      }
      if (cl < kNumClasses) {
        TCMalloc_ThreadCache* heap = TCMalloc_ThreadCache::GetCache();
        return heap->Allocate(class_to_size[cl]);
      }
    }
  
    // We will allocate directly from the page heap
    SpinLockHolder h(&pageheap_lock);
  
    if (align <= kPageSize) {
      // Any page-level allocation will be fine
      // TODO: We could put the rest of this page in the appropriate
      // TODO: cache but it does not seem worth it.
      Span* span = pageheap->New(pages(size));
      if (span == NULL) return NULL;
      return reinterpret_cast<void*>(span->start << kPageShift);
    }
  
    // Allocate extra pages and carve off an aligned portion
    const int alloc = pages(size + align);
    Span* span = pageheap->New(alloc);
    if (span == NULL) return NULL;
  
    // Skip starting portion so that we end up aligned
    int skip = 0;
    while ((((span->start+skip) << kPageShift) & (align - 1)) != 0) {
      skip++;
    }
    ASSERT(skip < alloc);
    if (skip > 0) {
      Span* rest = pageheap->Split(span, skip);
      pageheap->Delete(span);
      span = rest;
    }
  
    // Skip trailing portion that we do not need to return
    const size_t needed = pages(size);
    ASSERT(span->length >= needed);
    if (span->length > needed) {
      Span* trailer = pageheap->Split(span, needed);
      pageheap->Delete(trailer);
    }
    return reinterpret_cast<void*>(span->start << kPageShift);
  }
  #endif
  
  
  // The constructor allocates an object to ensure that initialization
  // runs before main(), and therefore we do not have a chance to become
  // multi-threaded before initialization.  We also create the TSD key
  // here.  Presumably by the time this constructor runs, glibc is in
  // good enough shape to handle pthread_key_create().
  //
  // The constructor also takes the opportunity to tell STL to use
  // tcmalloc.  We want to do this early, before construct time, so
  // all user STL allocations go through tcmalloc (which works really
  // well for STL).
  //
  // The destructor prints stats when the program exits.
  
  class TCMallocGuard {
   public:
    TCMallocGuard() {
  #ifndef KXC_CHANGES
      char *envval;
      if ((envval = getenv("TCMALLOC_DEBUG"))) {
        TCMallocDebug::level = atoi(envval);
        MESSAGE("Set tcmalloc debugging level to %d\n", TCMallocDebug::level);
      }
  #endif
      do_free(do_malloc(1));
      TCMalloc_ThreadCache::InitTSD();
      do_free(do_malloc(1));
  #ifndef KXC_CHANGES
      MallocExtension::Register(new TCMallocImplementation);
  #endif
    }
  
  #ifndef KXC_CHANGES
    ~TCMallocGuard() {
      const char* env = getenv("MALLOCSTATS");
      if (env != NULL) {
        int level = atoi(env);
        if (level < 1) level = 1;
        PrintStats(level);
      }
    }
  #endif
  };
  
  static TCMallocGuard module_enter_exit_hook;
  
  
  //-------------------------------------------------------------------
  // Exported routines
  //-------------------------------------------------------------------
  
  // CAVEAT: The code structure below ensures that MallocHook methods are always
  //         called from the stack frame of the invoked allocation function.
  //         heap-checker.cc depends on this to start a stack trace from
  //         the call to the (de)allocation function.
  
  #ifndef KXC_CHANGES
  extern "C" 
  #endif
  void* malloc(size_t size) {
    void* result = do_malloc(size);
  #ifndef KXC_CHANGES
    MallocHook::InvokeNewHook(result, size);
  #endif
    return result;
  }
  
  #ifndef KXC_CHANGES
  extern "C" 
  #endif
  void free(void* ptr) {
  #ifndef KXC_CHANGES
    MallocHook::InvokeDeleteHook(ptr);
  #endif
    do_free(ptr);
  }
  
  #ifndef KXC_CHANGES
  extern "C" 
  #endif
  void* calloc(size_t n, size_t elem_size) {
    void* result = do_malloc(n * elem_size);
    if (result != NULL) {
      memset(result, 0, n * elem_size);
    }
  #ifndef KXC_CHANGES
    MallocHook::InvokeNewHook(result, n * elem_size);
  #endif
    return result;
  }
  
  #ifndef KXC_CHANGES
  extern "C" 
  #endif
  void cfree(void* ptr) {
  #ifndef KXC_CHANGES
      MallocHook::InvokeDeleteHook(ptr);
  #endif
    do_free(ptr);
  }
  
  #ifndef KXC_CHANGES
  extern "C" 
  #endif
  void* realloc(void* old_ptr, size_t new_size) {
    if (old_ptr == NULL) {
      void* result = do_malloc(new_size);
  #ifndef KXC_CHANGES
      MallocHook::InvokeNewHook(result, new_size);
  #endif
      return result;
    }
    if (new_size == 0) {
  #ifndef KXC_CHANGES
      MallocHook::InvokeDeleteHook(old_ptr);
  #endif
      do_free(old_ptr);
      return NULL;
    }
  
    // Get the size of the old entry
    const PageID p = reinterpret_cast<uintptr_t>(old_ptr) >> kPageShift;
    Span* span = pageheap->GetDescriptor(p);
    size_t old_size;
    if (span->sizeclass != 0) {
      old_size = ByteSizeForClass(span->sizeclass);
    } else {
      old_size = span->length << kPageShift;
    }
  
    // Reallocate if the new size is larger than the old size,
    // or if the new size is significantly smaller than the old size.
    if ((new_size > old_size) || (AllocationSize(new_size) < old_size)) {
      // Need to reallocate
      void* new_ptr = do_malloc(new_size);
      if (new_ptr == NULL) {
        return NULL;
      }
  #ifndef KXC_CHANGES
      MallocHook::InvokeNewHook(new_ptr, new_size);
  #endif
      memcpy(new_ptr, old_ptr, ((old_size < new_size) ? old_size : new_size));
  #ifndef KXC_CHANGES
      MallocHook::InvokeDeleteHook(old_ptr);
  #endif
      do_free(old_ptr);
      return new_ptr;
    } else {
      return old_ptr;
    }
  }
  
  #ifndef COMPILER_INTEL
  #define OPNEW_THROW
  #define OPDELETE_THROW
  #else
  #define OPNEW_THROW throw(std::bad_alloc)
  #define OPDELETE_THROW throw()
  #endif
  
  #ifndef KXC_CHANGES
  
  void* operator new(size_t size) OPNEW_THROW {
    void* p = do_malloc(size);
    if (p == NULL) {
      MESSAGE("Unable to allocate %" PRIuS " bytes: new failed\n", size);
      abort();
    }
    MallocHook::InvokeNewHook(p, size);
    return p;
  }
  
  void operator delete(void* p) OPDELETE_THROW {
    MallocHook::InvokeDeleteHook(p);
    do_free(p);
  }
  
  void* operator new[](size_t size) OPNEW_THROW {
    void* p = do_malloc(size);
    if (p == NULL) {
      MESSAGE("Unable to allocate %" PRIuS " bytes: new failed\n", size);
      abort();
    }
    MallocHook::InvokeNewHook(p, size);
    return p;
  }
  
  void operator delete[](void* p) OPDELETE_THROW {
    MallocHook::InvokeDeleteHook(p);
    do_free(p);
  }
  
  extern "C" void* memalign(size_t align, size_t size) {
    void* result = do_memalign(align, size);
    MallocHook::InvokeNewHook(result, size);
    return result;
  }
  
  extern "C" int posix_memalign(void** result_ptr, size_t align, size_t size) {
    if (((align % sizeof(void*)) != 0) ||
        ((align & (align - 1)) != 0) ||
        (align == 0)) {
      return EINVAL;
    }
  
    void* result = do_memalign(align, size);
    MallocHook::InvokeNewHook(result, size);
    if (result == NULL) {
      return ENOMEM;
    } else {
      *result_ptr = result;
      return 0;
    }
  }
  
  static size_t pagesize = 0;
  
  extern "C" void* valloc(size_t size) {
    // Allocate page-aligned object of length >= size bytes
    if (pagesize == 0) pagesize = getpagesize();
    void* result = do_memalign(pagesize, size);
    MallocHook::InvokeNewHook(result, size);
    return result;
  }
  
  extern "C" void* pvalloc(size_t size) {
    // Round up size to a multiple of pagesize
    if (pagesize == 0) pagesize = getpagesize();
    size = (size + pagesize - 1) & ~(pagesize - 1);
    void* result = do_memalign(pagesize, size);
    MallocHook::InvokeNewHook(result, size);
    return result;
  }
  
  extern "C" void malloc_stats(void) {
    PrintStats(1);
  }
  
  extern "C" int mallopt(int cmd, int value) {
    return 1;     // Indicates error
  }
  
  extern "C" struct mallinfo mallinfo(void) {
    TCMallocStats stats;
    ExtractStats(&stats, NULL);
  
    // Just some of the fields are filled in.
    struct mallinfo info;
    memset(&info, 0, sizeof(info));
  
    // Unfortunately, the struct contains "int" field, so some of the
    // size values will be truncated.
    info.arena     = static_cast<int>(stats.system_bytes);
    info.fsmblks   = static_cast<int>(stats.thread_bytes + stats.central_bytes);
    info.fordblks  = static_cast<int>(stats.pageheap_bytes);
    info.uordblks  = static_cast<int>(stats.system_bytes
                                      - stats.thread_bytes
                                      - stats.central_bytes
                                      - stats.pageheap_bytes);
  
    return info;
  }
  
  //-------------------------------------------------------------------
  // Some library routines on RedHat 9 allocate memory using malloc()
  // and free it using __libc_free() (or vice-versa).  Since we provide
  // our own implementations of malloc/free, we need to make sure that
  // the __libc_XXX variants also point to the same implementations.
  //-------------------------------------------------------------------
  
  extern "C" {
  #if defined(__GNUC__) && defined(HAVE___ATTRIBUTE__)
    // Potentially faster variants that use the gcc alias extension
  #define ALIAS(x) __attribute__ ((weak, alias (x)))
    void* __libc_malloc(size_t size)              ALIAS("malloc");
    void  __libc_free(void* ptr)                  ALIAS("free");
    void* __libc_realloc(void* ptr, size_t size)  ALIAS("realloc");
    void* __libc_calloc(size_t n, size_t size)    ALIAS("calloc");
    void  __libc_cfree(void* ptr)                 ALIAS("cfree");
    void* __libc_memalign(size_t align, size_t s) ALIAS("memalign");
    void* __libc_valloc(size_t size)              ALIAS("valloc");
    void* __libc_pvalloc(size_t size)             ALIAS("pvalloc");
    int __posix_memalign(void** r, size_t a, size_t s) ALIAS("posix_memalign");
  #undef ALIAS
  #else
    // Portable wrappers
    void* __libc_malloc(size_t size)              { return malloc(size);       }
    void  __libc_free(void* ptr)                  { free(ptr);                 }
    void* __libc_realloc(void* ptr, size_t size)  { return realloc(ptr, size); }
    void* __libc_calloc(size_t n, size_t size)    { return calloc(n, size);    }
    void  __libc_cfree(void* ptr)                 { cfree(ptr);                }
    void* __libc_memalign(size_t align, size_t s) { return memalign(align, s); }
    void* __libc_valloc(size_t size)              { return valloc(size);       }
    void* __libc_pvalloc(size_t size)             { return pvalloc(size);      }
    int __posix_memalign(void** r, size_t a, size_t s) {
      return posix_memalign(r, a, s);
    }
  #endif
  
  }
  
  #endif
  
  #if KXC_CHANGES
  } // namespace KJS
  #endif
  
  #endif // USE_SYSTEM_MALLOC
  
  
  
  1.1                  JavaScriptCore/kxmlcore/FastMalloc.h
  
  Index: FastMalloc.h
  ===================================================================
  // -*- mode: c++; c-basic-offset: 4 -*-
  /*
   *  This file is part of the KDE libraries
   *  Copyright (C) 2005 Apple Computer, Inc.
   *
   *  This library is free software; you can redistribute it and/or
   *  modify it under the terms of the GNU Library General Public
   *  License as published by the Free Software Foundation; either
   *  version 2 of the License, or (at your option) any later version.
   *
   *  This library is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   *  Library General Public License for more details.
   *
   *  You should have received a copy of the GNU Library General Public License
   *  along with this library; see the file COPYING.LIB.  If not, write to
   *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   *  Boston, MA 02111-1307, USA.
   *
   */
  
  #ifndef KXMLCORE_FAST_MALLOC_H
  #define KXMLCORE_FAST_MALLOC_H
  
  #include <stdlib.h>
  
  namespace KXMLCore {
  
      void *fastMalloc(size_t n);
      void *fastCalloc(size_t n_elements, size_t element_size);
      void fastFree(void* p);
      void *fastRealloc(void* p, size_t n);
      
      struct FastAllocated {
          void* operator new(size_t s) { return fastMalloc(s); }
          void operator delete(void* p) { fastFree(p); }
          void* operator new[](size_t s) { return fastMalloc(s); }
          void operator delete[](void* p) { fastFree(p); }
      };
      
      // POD types can't have a base class, so they have to use a macro to
      // add the appropriate operators
      #define FAST_ALLOCATED_POD \
          void* operator new(size_t s) { return fastMalloc(s); } \
          void operator delete(void* p) { fastFree(p); } \
          void* operator new[](size_t s) { return fastMalloc(s); } \
          void operator delete[](void* p) { fastFree(p); } \
  
  } // namespace KXMLCore
  
  using KXMLCore::fastMalloc;
  using KXMLCore::fastCalloc;
  using KXMLCore::fastRealloc;
  using KXMLCore::fastFree;
  using KXMLCore::FastAllocated;
  
  #endif /* KXMLCORE_FAST_MALLOC_H */
  
  
  
  1.1                  JavaScriptCore/kxmlcore/SharedPtr.h
  
  Index: SharedPtr.h
  ===================================================================
  // -*- mode: c++; c-basic-offset: 4 -*-
  /*
   *  This file is part of the KDE libraries
   *  Copyright (C) 2005 Apple Computer, Inc.
   *
   *  This library is free software; you can redistribute it and/or
   *  modify it under the terms of the GNU Library General Public
   *  License as published by the Free Software Foundation; either
   *  version 2 of the License, or (at your option) any later version.
   *
   *  This library is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   *  Library General Public License for more details.
   *
   *  You should have received a copy of the GNU Library General Public License
   *  along with this library; see the file COPYING.LIB.  If not, write to
   *  the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
   *  Boston, MA 02110-1301, USA.
   *
   */
  
  #ifndef KXMLCORE_SHARED_PTR_H
  #define KXMLCORE_SHARED_PTR_H
  
  namespace KXMLCore {
  
      // FIXME: Change template name to RefPtr?
      template <class T> class SharedPtr
      {
      public:
          SharedPtr() : m_ptr(NULL) {}
          SharedPtr(T *ptr) : m_ptr(ptr) { if (ptr) ptr->ref(); }
          SharedPtr(const SharedPtr &o) : m_ptr(o.m_ptr) { if (T *ptr = m_ptr) ptr->ref(); }
          ~SharedPtr() { if (T *ptr = m_ptr) ptr->deref(); }
          
          template <class U> SharedPtr(const SharedPtr<U> &o) : m_ptr(o.get()) { if (T *ptr = m_ptr) ptr->ref(); }
          
          // FIXME: Deprecate in favor of operators below, then remove?
          bool isNull() const { return m_ptr == NULL; }
          bool notNull() const { return m_ptr != NULL; }
          
          // FIXME: Deprecate in favor of operator=, then remove?
          void reset() { if (T *ptr = m_ptr) ptr->deref(); m_ptr = NULL; }
          void reset(T *o) { if (o) o->ref(); if (T *ptr = m_ptr) ptr->deref(); m_ptr = o; }
          
          T *get() const { return m_ptr; }
          
          T &operator*() const { return *m_ptr; }
          T *operator->() const { return m_ptr; }
          
          bool operator!() const { return m_ptr == NULL; }
          operator bool() const { return m_ptr != NULL; }
          
          SharedPtr &operator=(const SharedPtr &);
          SharedPtr &operator=(T *);
          
      private:
          T *m_ptr;
          
          operator int() const; // deliberately not implemented; helps prevent operator bool from converting to int accidentally
      };
      
      template <class T> SharedPtr<T> &SharedPtr<T>::operator=(const SharedPtr<T> &o) 
      {
          T *optr = o.m_ptr;
          if (optr)
              optr->ref();
          if (T *ptr = m_ptr)
              ptr->deref();
          m_ptr = optr;
          return *this;
      }
      
      template <class T> inline SharedPtr<T> &SharedPtr<T>::operator=(T *optr)
      {
          if (optr)
              optr->ref();
          if (T *ptr = m_ptr)
              ptr->deref();
          m_ptr = optr;
          return *this;
      }
      
      template <class T> inline bool operator==(const SharedPtr<T> &a, const SharedPtr<T> &b) 
      { 
          return a.get() == b.get(); 
      }
  
      template <class T> inline bool operator==(const SharedPtr<T> &a, const T *b) 
      { 
          return a.get() == b; 
      }
      
      template <class T> inline bool operator==(const T *a, const SharedPtr<T> &b) 
      {
          return a == b.get(); 
      }
      
      template <class T> inline bool operator!=(const SharedPtr<T> &a, const SharedPtr<T> &b) 
      { 
          return a.get() != b.get(); 
      }
  
      template <class T> inline bool operator!=(const SharedPtr<T> &a, const T *b)
      {
          return a.get() != b; 
      }
  
      template <class T> inline bool operator!=(const T *a, const SharedPtr<T> &b) 
      { 
          return a != b.get(); 
      }
      
      template <class T, class U> inline SharedPtr<T> static_pointer_cast(const SharedPtr<U> &p) 
      { 
          return SharedPtr<T>(static_cast<T *>(p.get())); 
      }
  
      template <class T, class U> inline SharedPtr<T> const_pointer_cast(const SharedPtr<U> &p) 
      { 
          return SharedPtr<T>(const_cast<T *>(p.get())); 
      }
  
  } // namespace KXMLCore
  
  using KXMLCore::SharedPtr;
  using KXMLCore::static_pointer_cast;
  using KXMLCore::const_pointer_cast;
  
  #endif // KXMLCORE_SHARED_PTR_H
  
  
  
  1.1                  JavaScriptCore/kxmlcore/TCPageMap.h
  
  Index: TCPageMap.h
  ===================================================================
  // Copyright (c) 2005, Google Inc.
  // All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are
  // met:
  // 
  //     * Redistributions of source code must retain the above copyright
  // notice, this list of conditions and the following disclaimer.
  //     * Redistributions in binary form must reproduce the above
  // copyright notice, this list of conditions and the following disclaimer
  // in the documentation and/or other materials provided with the
  // distribution.
  //     * Neither the name of Google Inc. nor the names of its
  // contributors may be used to endorse or promote products derived from
  // this software without specific prior written permission.
  // 
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  // ---
  // Author: Sanjay Ghemawat <opensource at google.com>
  //
  // A data structure used by the caching malloc.  It maps from page# to
  // a pointer that contains info about that page.  We use two
  // representations: one for 32-bit addresses, and another for 64 bit
  // addresses.  Both representations provide the same interface.  The
  // first representation is implemented as a flat array, the seconds as
  // a three-level radix tree that strips away approximately 1/3rd of
  // the bits every time.
  //
  // The BITS parameter should be the number of bits required to hold
  // a page number.  E.g., with 32 bit pointers and 4K pages (i.e.,
  // page offset fits in lower 12 bits), BITS == 20.
  
  #ifndef TCMALLOC_PAGEMAP_H__
  #define TCMALLOC_PAGEMAP_H__
  
  #include "config.h"
  #if defined HAVE_STDINT_H
  #include <stdint.h>
  #elif defined HAVE_INTTYPES_H
  #include <inttypes.h>
  #else
  #include <sys/types.h>
  #endif
  
  #include "kxmlcore/Assertions.h"
  
  // Single-level array
  template <int BITS>
  class TCMalloc_PageMap1 {
   private:
    void** array_;
  
   public:
    typedef uintptr_t Number;
  
    explicit TCMalloc_PageMap1(void* (*allocator)(size_t)) {
      array_ = reinterpret_cast<void**>((*allocator)(sizeof(void*) << BITS));
      memset(array_, 0, sizeof(void*) << BITS);
    }
  
    // Ensure that the map contains initialized entries "x .. x+n-1".
    // Returns true if successful, false if we could not allocate memory.
    bool Ensure(Number x, size_t n) {
      // Nothing to do since flat array was allocate at start
      return true;
    }
  
    // REQUIRES "k" is in range "[0,2^BITS-1]".
    // REQUIRES "k" has been ensured before.
    //
    // Return the current value for KEY.  Returns "Value()" if not
    // yet set.
    void* get(Number k) const {
      return array_[k];
    }
  
    // REQUIRES "k" is in range "[0,2^BITS-1]".
    // REQUIRES "k" has been ensured before.
    //
    // Sets the value for KEY.
    void set(Number k, void* v) {
      array_[k] = v;
    }
  };
  
  // Two-level radix tree
  template <int BITS>
  class TCMalloc_PageMap2 {
   private:
    // Put 32 entries in the root and (2^BITS)/32 entries in each leaf.
    static const int ROOT_BITS = 5;
    static const int ROOT_LENGTH = 1 << ROOT_BITS;
  
    static const int LEAF_BITS = BITS - ROOT_BITS;
    static const int LEAF_LENGTH = 1 << LEAF_BITS;
  
    // Leaf node
    struct Leaf {
      void* values[LEAF_LENGTH];
    };
  
    Leaf* root_[ROOT_LENGTH];             // Pointers to 32 child nodes
    void* (*allocator_)(size_t);          // Memory allocator
  
   public:
    typedef uintptr_t Number;
  
    explicit TCMalloc_PageMap2(void* (*allocator)(size_t)) {
      allocator_ = allocator;
      memset(root_, 0, sizeof(root_));
    }
  
    void* get(Number k) const {
      ASSERT(k >> BITS == 0);
      const Number i1 = k >> LEAF_BITS;
      const Number i2 = k & (LEAF_LENGTH-1);
      return root_[i1]->values[i2];
    }
  
    void set(Number k, void* v) {
      ASSERT(k >> BITS == 0);
      const Number i1 = k >> LEAF_BITS;
      const Number i2 = k & (LEAF_LENGTH-1);
      root_[i1]->values[i2] = v;
    }
  
    bool Ensure(Number start, size_t n) {
      for (Number key = start; key <= start + n - 1; ) {
        const Number i1 = key >> LEAF_BITS;
  
        // Make 2nd level node if necessary
        if (root_[i1] == NULL) {
          Leaf* leaf = reinterpret_cast<Leaf*>((*allocator_)(sizeof(Leaf)));
          if (leaf == NULL) return false;
          memset(leaf, 0, sizeof(*leaf));
          root_[i1] = leaf;
        }
  
        // Advance key past whatever is covered by this leaf node
        key = ((key >> LEAF_BITS) + 1) << LEAF_BITS;
      }
      return true;
    }
  };
  
  // Three-level radix tree
  template <int BITS>
  class TCMalloc_PageMap3 {
   private:
    // How many bits should we consume at each interior level
    static const int INTERIOR_BITS = (BITS + 2) / 3; // Round-up
    static const int INTERIOR_LENGTH = 1 << INTERIOR_BITS;
  
    // How many bits should we consume at leaf level
    static const int LEAF_BITS = BITS - 2*INTERIOR_BITS;
    static const int LEAF_LENGTH = 1 << LEAF_BITS;
  
    // Interior node
    struct Node {
      Node* ptrs[INTERIOR_LENGTH];
    };
  
    // Leaf node
    struct Leaf {
      void* values[LEAF_LENGTH];
    };
  
    Node* root_;                          // Root of radix tree
    void* (*allocator_)(size_t);          // Memory allocator
  
    Node* NewNode() {
      Node* result = reinterpret_cast<Node*>((*allocator_)(sizeof(Node)));
      if (result != NULL) {
        memset(result, 0, sizeof(*result));
      }
      return result;
    }
  
   public:
    typedef uintptr_t Number;
  
    explicit TCMalloc_PageMap3(void* (*allocator)(size_t)) {
      allocator_ = allocator;
      root_ = NewNode();
    }
  
    void* get(Number k) const {
      ASSERT(k >> BITS == 0);
      const Number i1 = k >> (LEAF_BITS + INTERIOR_BITS);
      const Number i2 = (k >> LEAF_BITS) & (INTERIOR_LENGTH-1);
      const Number i3 = k & (LEAF_LENGTH-1);
      return reinterpret_cast<Leaf*>(root_->ptrs[i1]->ptrs[i2])->values[i3];
    }
  
    void set(Number k, void* v) {
      ASSERT(k >> BITS == 0);
      const Number i1 = k >> (LEAF_BITS + INTERIOR_BITS);
      const Number i2 = (k >> LEAF_BITS) & (INTERIOR_LENGTH-1);
      const Number i3 = k & (LEAF_LENGTH-1);
      reinterpret_cast<Leaf*>(root_->ptrs[i1]->ptrs[i2])->values[i3] = v;
    }
  
    bool Ensure(Number start, size_t n) {
      for (Number key = start; key <= start + n - 1; ) {
        const Number i1 = key >> (LEAF_BITS + INTERIOR_BITS);
        const Number i2 = (key >> LEAF_BITS) & (INTERIOR_LENGTH-1);
  
        // Make 2nd level node if necessary
        if (root_->ptrs[i1] == NULL) {
          Node* n = NewNode();
          if (n == NULL) return false;
          root_->ptrs[i1] = n;
        }
  
        // Make leaf node if necessary
        if (root_->ptrs[i1]->ptrs[i2] == NULL) {
          Leaf* leaf = reinterpret_cast<Leaf*>((*allocator_)(sizeof(Leaf)));
          if (leaf == NULL) return false;
          memset(leaf, 0, sizeof(*leaf));
          root_->ptrs[i1]->ptrs[i2] = reinterpret_cast<Node*>(leaf);
        }
  
        // Advance key past whatever is covered by this leaf node
        key = ((key >> LEAF_BITS) + 1) << LEAF_BITS;
      }
      return true;
    }
  };
  
  #endif  // TCMALLOC_PAGEMAP_H__
  
  
  
  1.1                  JavaScriptCore/kxmlcore/TCSpinLock.h
  
  Index: TCSpinLock.h
  ===================================================================
  // Copyright (c) 2005, Google Inc.
  // All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are
  // met:
  // 
  //     * Redistributions of source code must retain the above copyright
  // notice, this list of conditions and the following disclaimer.
  //     * Redistributions in binary form must reproduce the above
  // copyright notice, this list of conditions and the following disclaimer
  // in the documentation and/or other materials provided with the
  // distribution.
  //     * Neither the name of Google Inc. nor the names of its
  // contributors may be used to endorse or promote products derived from
  // this software without specific prior written permission.
  // 
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  // ---
  // Author: Sanjay Ghemawat <opensource at google.com>
  
  #ifndef TCMALLOC_INTERNAL_SPINLOCK_H__
  #define TCMALLOC_INTERNAL_SPINLOCK_H__
  
  #include "config.h"
  #include <time.h>       /* For nanosleep() */
  #include <sched.h>      /* For sched_yield() */
  #if defined HAVE_STDINT_H
  #include <stdint.h>
  #elif defined HAVE_INTTYPES_H
  #include <inttypes.h>
  #else
  #include <sys/types.h>
  #endif
  #include <stdlib.h>	/* for abort() */
  
  // FIXME: it would be nice to port the fast version to PowerPC but right now it is not
  // showing up on the profile
  #if defined __i386__ && defined __GNUC__
  
  static void TCMalloc_SlowLock(volatile unsigned int* lockword);
  
  // The following is a struct so that it can be initialized at compile time
  struct TCMalloc_SpinLock {
    volatile unsigned int private_lockword_;
  
    inline void Init() { private_lockword_ = 0; }
    inline void Finalize() { }
      
    inline void Lock() {
      int r;
      __asm__ __volatile__
        ("xchgl %0, %1"
         : "=r"(r), "=m"(private_lockword_)
         : "0"(1), "m"(private_lockword_)
         : "memory");
      if (r) TCMalloc_SlowLock(&private_lockword_);
    }
  
    inline void Unlock() {
      __asm__ __volatile__
        ("movl $0, %0"
         : "=m"(private_lockword_)
         : "m" (private_lockword_)
         : "memory");
    }
  };
  
  #define SPINLOCK_INITIALIZER { 0 }
  
  static void TCMalloc_SlowLock(volatile unsigned int* lockword) {
    sched_yield();        // Yield immediately since fast path failed
    while (true) {
      int r;
      __asm__ __volatile__
        ("xchgl %0, %1"
         : "=r"(r), "=m"(*lockword)
         : "0"(1), "m"(*lockword)
         : "memory");
      if (!r) {
        return;
      }
  
      // This code was adapted from the ptmalloc2 implementation of
      // spinlocks which would sched_yield() upto 50 times before
      // sleeping once for a few milliseconds.  Mike Burrows suggested
      // just doing one sched_yield() outside the loop and always
      // sleeping after that.  This change helped a great deal on the
      // performance of spinlocks under high contention.  A test program
      // with 10 threads on a dual Xeon (four virtual processors) went
      // from taking 30 seconds to 16 seconds.
  
      // Sleep for a few milliseconds
      struct timespec tm;
      tm.tv_sec = 0;
      tm.tv_nsec = 2000001;
      nanosleep(&tm, NULL);
    }
  }
  
  #else
  
  #include <pthread.h>
  
  // Portable version
  struct TCMalloc_SpinLock {
    pthread_mutex_t private_lock_;
  
    inline void Init() {
      if (pthread_mutex_init(&private_lock_, NULL) != 0) abort();
    }
    inline void Finalize() {
      if (pthread_mutex_destroy(&private_lock_) != 0) abort();
    }
    inline void Lock() {
      if (pthread_mutex_lock(&private_lock_) != 0) abort();
    }
    inline void Unlock() {
      if (pthread_mutex_unlock(&private_lock_) != 0) abort();
    }
  };
  
  #define SPINLOCK_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
  
  #endif
  
  // Corresponding locker object that arranges to acquire a spinlock for
  // the duration of a C++ scope.
  class TCMalloc_SpinLockHolder {
   private:
    TCMalloc_SpinLock* lock_;
   public:
    inline explicit TCMalloc_SpinLockHolder(TCMalloc_SpinLock* l)
      : lock_(l) { l->Lock(); }
    inline ~TCMalloc_SpinLockHolder() { lock_->Unlock(); }
  };
  
  // Short-hands for convenient use by tcmalloc.cc
  typedef TCMalloc_SpinLock SpinLock;
  typedef TCMalloc_SpinLockHolder SpinLockHolder;
  
  #endif  // TCMALLOC_INTERNAL_SPINLOCK_H__
  
  
  
  1.1                  JavaScriptCore/kxmlcore/TCSystemAlloc.cpp
  
  Index: TCSystemAlloc.cpp
  ===================================================================
  // Copyright (c) 2005, Google Inc.
  // All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are
  // met:
  // 
  //     * Redistributions of source code must retain the above copyright
  // notice, this list of conditions and the following disclaimer.
  //     * Redistributions in binary form must reproduce the above
  // copyright notice, this list of conditions and the following disclaimer
  // in the documentation and/or other materials provided with the
  // distribution.
  //     * Neither the name of Google Inc. nor the names of its
  // contributors may be used to endorse or promote products derived from
  // this software without specific prior written permission.
  // 
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  // ---
  // Author: Sanjay Ghemawat
  
  #include "config.h"
  #if defined HAVE_STDINT_H
  #include <stdint.h>
  #elif defined HAVE_INTTYPES_H
  #include <inttypes.h>
  #else
  #include <sys/types.h>
  #endif
  #include <unistd.h>
  #include <fcntl.h>
  #include <sys/mman.h>
  #include "TCSystemAlloc.h"
  #include "TCSpinLock.h"
  
  #ifndef MAP_ANONYMOUS
  #define MAP_ANONYMOUS MAP_ANON
  #endif
  
  // Structure for discovering alignment
  union MemoryAligner {
    void*  p;
    double d;
    size_t s;
  };
  
  static SpinLock spinlock = SPINLOCK_INITIALIZER;
    
  // Page size is initialized on demand
  static size_t pagesize = 0;
  
  // Configuration parameters.
  //
  // if use_devmem is true, either use_sbrk or use_mmap must also be true.
  // For 2.2 kernels, it looks like the sbrk address space (500MBish) and
  // the mmap address space (1300MBish) are disjoint, so we need both allocators
  // to get as much virtual memory as possible.
  static bool use_devmem = true;
  static bool use_sbrk = true;
  static bool use_mmap = true;
  
  // Flags to keep us from retrying allocators that failed.
  static bool devmem_failure = false;
  static bool sbrk_failure = false;
  static bool mmap_failure = false;
  
  #ifndef KXC_CHANGES
  DEFINE_int32(malloc_devmem_start, 0,
               "Physical memory starting location in MB for /dev/mem allocation."
               "  Setting this to 0 disables /dev/mem allocation");
  DEFINE_int32(malloc_devmem_limit, 0,
               "Physical memory limit location in MB for /dev/mem allocation."
               "  Setting this to 0 means no limit.");
  #else
  static const int32_t FLAGS_malloc_devmem_start = 0;
  static const int32_t FLAGS_malloc_devmem_limit = 0;
  #endif
  
  #ifdef HAVE_SBRK
  
  static void* TrySbrk(size_t size, size_t alignment) {
    size = ((size + alignment - 1) / alignment) * alignment;
    void* result = sbrk(size);
    if (result == reinterpret_cast<void*>(-1)) {
      sbrk_failure = true;
      return NULL;
    }
  
    // Is it aligned?
    uintptr_t ptr = reinterpret_cast<uintptr_t>(result);
    if ((ptr & (alignment-1)) == 0)  return result;
  
    // Try to get more memory for alignment
    size_t extra = alignment - (ptr & (alignment-1));
    void* r2 = sbrk(extra);
    if (reinterpret_cast<uintptr_t>(r2) == (ptr + size)) {
      // Contiguous with previous result
      return reinterpret_cast<void*>(ptr + extra);
    }
  
    // Give up and ask for "size + alignment - 1" bytes so
    // that we can find an aligned region within it.
    result = sbrk(size + alignment - 1);
    if (result == reinterpret_cast<void*>(-1)) {
      sbrk_failure = true;
      return NULL;
    }
    ptr = reinterpret_cast<uintptr_t>(result);
    if ((ptr & (alignment-1)) != 0) {
      ptr += alignment - (ptr & (alignment-1));
    }
    return reinterpret_cast<void*>(ptr);
  }
  
  #endif /* HAVE_SBRK */
  
  #ifdef HAVE_MMAP
  
  static void* TryMmap(size_t size, size_t alignment) {
    // Enforce page alignment
    if (pagesize == 0) pagesize = getpagesize();
    if (alignment < pagesize) alignment = pagesize;
    size = ((size + alignment - 1) / alignment) * alignment;
  
    // Ask for extra memory if alignment > pagesize
    size_t extra = 0;
    if (alignment > pagesize) {
      extra = alignment - pagesize;
    }
    void* result = mmap(NULL, size + extra,
                        PROT_READ|PROT_WRITE,
                        MAP_PRIVATE|MAP_ANONYMOUS,
                        -1, 0);
    if (result == reinterpret_cast<void*>(MAP_FAILED)) {
      mmap_failure = true;
      return NULL;
    }
  
    // Adjust the return memory so it is aligned
    uintptr_t ptr = reinterpret_cast<uintptr_t>(result);
    size_t adjust = 0;
    if ((ptr & (alignment - 1)) != 0) {
      adjust = alignment - (ptr & (alignment - 1));
    }
  
    // Return the unused memory to the system
    if (adjust > 0) {
      munmap(reinterpret_cast<void*>(ptr), adjust);
    }
    if (adjust < extra) {
      munmap(reinterpret_cast<void*>(ptr + adjust + size), extra - adjust);
    }
  
    ptr += adjust;
    return reinterpret_cast<void*>(ptr);
  }
  
  #endif /* HAVE_MMAP */
  
  static void* TryDevMem(size_t size, size_t alignment) {
    static bool initialized = false;
    static off_t physmem_base;  // next physical memory address to allocate
    static off_t physmem_limit; // maximum physical address allowed
    static int physmem_fd;      // file descriptor for /dev/mem
    
    // Check if we should use /dev/mem allocation.  Note that it may take
    // a while to get this flag initialized, so meanwhile we fall back to
    // the next allocator.  (It looks like 7MB gets allocated before
    // this flag gets initialized -khr.)
    if (FLAGS_malloc_devmem_start == 0) {
      // NOTE: not a devmem_failure - we'd like TCMalloc_SystemAlloc to
      // try us again next time.
      return NULL;
    }
    
    if (!initialized) {
      physmem_fd = open("/dev/mem", O_RDWR);
      if (physmem_fd < 0) {
        devmem_failure = true;
        return NULL;
      }
      physmem_base = FLAGS_malloc_devmem_start*1024LL*1024LL;
      physmem_limit = FLAGS_malloc_devmem_limit*1024LL*1024LL;
      initialized = true;
    }
    
    // Enforce page alignment
    if (pagesize == 0) pagesize = getpagesize();
    if (alignment < pagesize) alignment = pagesize;
    size = ((size + alignment - 1) / alignment) * alignment;
  
    // Ask for extra memory if alignment > pagesize
    size_t extra = 0;
    if (alignment > pagesize) {
      extra = alignment - pagesize;
    }
    
    // check to see if we have any memory left
    if (physmem_limit != 0 && physmem_base + size + extra > physmem_limit) {
      devmem_failure = true;
      return NULL;
    }
    void *result = mmap(0, size + extra, PROT_WRITE|PROT_READ,
                        MAP_SHARED, physmem_fd, physmem_base);
    if (result == reinterpret_cast<void*>(MAP_FAILED)) {
      devmem_failure = true;
      return NULL;
    }
    uintptr_t ptr = reinterpret_cast<uintptr_t>(result);
    
    // Adjust the return memory so it is aligned
    size_t adjust = 0;
    if ((ptr & (alignment - 1)) != 0) {
      adjust = alignment - (ptr & (alignment - 1));
    }
    
    // Return the unused virtual memory to the system
    if (adjust > 0) {
      munmap(reinterpret_cast<void*>(ptr), adjust);
    }
    if (adjust < extra) {
      munmap(reinterpret_cast<void*>(ptr + adjust + size), extra - adjust);
    }
    
    ptr += adjust;
    physmem_base += adjust + size;
    
    return reinterpret_cast<void*>(ptr);
  }
  
  void* TCMalloc_SystemAlloc(size_t size, size_t alignment) {
  #ifndef KXC_CHANGES
    if (TCMallocDebug::level >= TCMallocDebug::kVerbose) {
      MESSAGE("TCMalloc_SystemAlloc(%" PRIuS ", %" PRIuS")\n", 
              size, alignment);
    }
  #endif
    SpinLockHolder lock_holder(&spinlock);
  
    // Enforce minimum alignment
    if (alignment < sizeof(MemoryAligner)) alignment = sizeof(MemoryAligner);
  
    // Try twice, once avoiding allocators that failed before, and once
    // more trying all allocators even if they failed before.
    for (int i = 0; i < 2; i++) {
      if (use_devmem && !devmem_failure) {
        void* result = TryDevMem(size, alignment);
        if (result != NULL) return result;
      }
      
  #ifdef HAVE_SBRK
      if (use_sbrk && !sbrk_failure) {
        void* result = TrySbrk(size, alignment);
        if (result != NULL) return result;
      }
  #endif
  
  #ifdef HAVE_MMAP    
      if (use_mmap && !mmap_failure) {
        void* result = TryMmap(size, alignment);
        if (result != NULL) return result;
      }
  #endif
  
      // nothing worked - reset failure flags and try again
      devmem_failure = false;
      sbrk_failure = false;
      mmap_failure = false;
    }
    return NULL;
  }
  
  
  
  1.1                  JavaScriptCore/kxmlcore/TCSystemAlloc.h
  
  Index: TCSystemAlloc.h
  ===================================================================
  // Copyright (c) 2005, Google Inc.
  // All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without
  // modification, are permitted provided that the following conditions are
  // met:
  // 
  //     * Redistributions of source code must retain the above copyright
  // notice, this list of conditions and the following disclaimer.
  //     * Redistributions in binary form must reproduce the above
  // copyright notice, this list of conditions and the following disclaimer
  // in the documentation and/or other materials provided with the
  // distribution.
  //     * Neither the name of Google Inc. nor the names of its
  // contributors may be used to endorse or promote products derived from
  // this software without specific prior written permission.
  // 
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  // ---
  // Author: Sanjay Ghemawat
  //
  // Routine that uses sbrk/mmap to allocate memory from the system.
  // Useful for implementing malloc.
  
  #ifndef TCMALLOC_SYSTEM_ALLOC_H__
  #define TCMALLOC_SYSTEM_ALLOC_H__
  
  // REQUIRES: "alignment" is a power of two or "0" to indicate default alignment
  //
  // Allocate and return "N" bytes of zeroed memory.  The returned
  // pointer is a multiple of "alignment" if non-zero.  Returns NULL
  // when out of memory.
  extern void* TCMalloc_SystemAlloc(size_t bytes, size_t alignment = 0);
  
  #endif /* TCMALLOC_SYSTEM_ALLOC_H__ */
  
  
  
  1.167     +162 -0    WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.166
  retrieving revision 1.167
  diff -u -r1.166 -r1.167
  --- ChangeLog	27 Sep 2005 02:10:48 -0000	1.166
  +++ ChangeLog	27 Sep 2005 22:36:55 -0000	1.167
  @@ -1,3 +1,165 @@
  +2005-09-26  Maciej Stachowiak  <mjs at apple.com>
  +
  +        Reviewed by John.
  +
  +	- replace dlmalloc with tcmalloc
  +	http://bugzilla.opendarwin.org/show_bug.cgi?id=5145
  +
  +	I also moved SharedPtr and the assertion code from WebCore into a
  +	new kxmlcore directory.
  +	
  +        * ForwardingHeaders/kjs/shared_ptr.h: Removed.
  +        * ForwardingHeaders/kxmlcore/Assertions.h: Added.
  +        * ForwardingHeaders/kxmlcore/FastMalloc.h: Added.
  +        * ForwardingHeaders/kxmlcore/SharedPtr.h: Added.
  +        * ForwardingHeaders/misc/main_thread_malloc.h: Removed.
  +        * WebCore.xcodeproj/project.pbxproj:
  +        * khtml/css/css_base.h:
  +        * khtml/css/css_computedstyle.cpp:
  +        * khtml/css/css_ruleimpl.h:
  +        * khtml/css/css_valueimpl.h:
  +        * khtml/css/cssstyleselector.h:
  +        * khtml/ecma/domparser.h:
  +        * khtml/ecma/kjs_css.h:
  +        * khtml/ecma/kjs_dom.cpp:
  +        * khtml/ecma/kjs_dom.h:
  +        * khtml/ecma/kjs_events.h:
  +        * khtml/ecma/kjs_html.cpp:
  +        * khtml/ecma/kjs_html.h:
  +        * khtml/ecma/kjs_range.h:
  +        * khtml/ecma/kjs_traversal.h:
  +        * khtml/ecma/kjs_views.cpp:
  +        * khtml/ecma/kjs_views.h:
  +        * khtml/ecma/kjs_window.cpp:
  +        * khtml/ecma/xmlhttprequest.h:
  +        * khtml/editing/SelectionController.cpp:
  +        * khtml/editing/append_node_command.cpp:
  +        * khtml/editing/apply_style_command.cpp:
  +        * khtml/editing/break_blockquote_command.cpp:
  +        * khtml/editing/composite_edit_command.cpp:
  +        * khtml/editing/delete_from_text_node_command.cpp:
  +        * khtml/editing/delete_selection_command.cpp:
  +        * khtml/editing/edit_command.cpp:
  +        * khtml/editing/htmlediting.cpp:
  +        * khtml/editing/insert_into_text_node_command.cpp:
  +        * khtml/editing/insert_line_break_command.cpp:
  +        * khtml/editing/insert_node_before_command.cpp:
  +        * khtml/editing/insert_paragraph_separator_command.cpp:
  +        * khtml/editing/insert_text_command.cpp:
  +        * khtml/editing/join_text_nodes_command.cpp:
  +        * khtml/editing/markup.cpp:
  +        * khtml/editing/merge_identical_elements_command.cpp:
  +        * khtml/editing/move_selection_command.cpp:
  +        * khtml/editing/rebalance_whitespace_command.cpp:
  +        * khtml/editing/remove_css_property_command.cpp:
  +        * khtml/editing/remove_node_attribute_command.cpp:
  +        * khtml/editing/remove_node_command.cpp:
  +        * khtml/editing/remove_node_preserving_children_command.cpp:
  +        * khtml/editing/replace_selection_command.cpp:
  +        * khtml/editing/set_node_attribute_command.cpp:
  +        * khtml/editing/split_element_command.cpp:
  +        * khtml/editing/split_text_node_command.cpp:
  +        * khtml/editing/split_text_node_containing_element.cpp:
  +        * khtml/editing/typing_command.cpp:
  +        * khtml/editing/visible_position.cpp:
  +        * khtml/editing/visible_position.h:
  +        * khtml/editing/wrap_contents_in_dummy_span_command.cpp:
  +        * khtml/html/html_imageimpl.h:
  +        * khtml/html/html_tableimpl.h:
  +        * khtml/html/htmlparser.cpp:
  +        * khtml/khtmlpart_p.h:
  +        * khtml/misc/arena.cpp:
  +        (ArenaAllocate):
  +        (FreeArenaList):
  +        (ArenaFinish):
  +        * khtml/misc/hashtable.h:
  +        (khtml::HashTable::~HashTable):
  +        (khtml::::allocateTable):
  +        (khtml::::rehash):
  +        (khtml::::clear):
  +        (khtml::::HashTable):
  +        * khtml/misc/loader.cpp:
  +        * khtml/misc/main_thread_malloc.cpp: Removed.
  +        * khtml/misc/main_thread_malloc.h: Removed.
  +        * khtml/misc/shared.h:
  +        * khtml/rendering/render_style.h:
  +        * khtml/xml/dom2_eventsimpl.h:
  +        * khtml/xml/dom2_rangeimpl.h:
  +        * khtml/xml/dom2_traversalimpl.h:
  +        * khtml/xml/dom2_viewsimpl.h:
  +        * khtml/xml/dom_docimpl.h:
  +        * khtml/xml/dom_elementimpl.cpp:
  +        (NamedAttrMapImpl::clearAttributes):
  +        (NamedAttrMapImpl::operator=):
  +        (NamedAttrMapImpl::addAttribute):
  +        (NamedAttrMapImpl::removeAttribute):
  +        * khtml/xml/dom_elementimpl.h:
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        * khtml/xml/dom_nodeimpl.h:
  +        * khtml/xml/dom_position.cpp:
  +        * khtml/xml/dom_stringimpl.h:
  +        * kwq/DOM-CSS.mm:
  +        * kwq/DOM.mm:
  +        * kwq/DOMEvents.mm:
  +        * kwq/DOMHTML.mm:
  +        * kwq/DOMInternal.mm:
  +        * kwq/DOMViews.mm:
  +        * kwq/KWQAccObject.mm:
  +        * kwq/KWQAccObjectCache.mm:
  +        * kwq/KWQArrayImpl.h:
  +        * kwq/KWQArrayImpl.mm:
  +        (KWQArrayImpl::KWQArrayPrivate::KWQArrayPrivate):
  +        (KWQArrayImpl::KWQArrayPrivate::~KWQArrayPrivate):
  +        (KWQArrayImpl::resize):
  +        * kwq/KWQAssertions.h: Removed.
  +        * kwq/KWQAssertions.m: Removed.
  +        * kwq/KWQButton.mm:
  +        * kwq/KWQCString.mm:
  +        * kwq/KWQClipboard.h:
  +        * kwq/KWQClipboard.mm:
  +        * kwq/KWQColor.mm:
  +        * kwq/KWQComboBox.mm:
  +        * kwq/KWQEditCommand.mm:
  +        * kwq/KWQExceptions.h:
  +        * kwq/KWQFileButton.mm:
  +        * kwq/KWQFontFamily.h:
  +        * kwq/KWQFormData.mm:
  +        * kwq/KWQKHTMLPart.h:
  +        * kwq/KWQKHTMLPart.mm:
  +        * kwq/KWQKPartsBrowserInterface.mm:
  +        * kwq/KWQKURL.mm:
  +        * kwq/KWQListBox.mm:
  +        * kwq/KWQListImpl.mm:
  +        * kwq/KWQLogging.h:
  +        * kwq/KWQLogging.m:
  +        * kwq/KWQMapImpl.h:
  +        * kwq/KWQMapImpl.mm:
  +        * kwq/KWQObject.mm:
  +        * kwq/KWQPageState.mm:
  +        * kwq/KWQPainter.mm:
  +        * kwq/KWQResourceLoader.mm:
  +        * kwq/KWQSignal.mm:
  +        * kwq/KWQSlot.mm:
  +        * kwq/KWQString.h:
  +        * kwq/KWQString.mm:
  +        (ALLOC_QCHAR):
  +        (QString::setBufferFromCFString):
  +        (allocatePageNode):
  +        * kwq/KWQTextArea.mm:
  +        * kwq/KWQTextCodec.mm:
  +        * kwq/KWQTextEdit.mm:
  +        * kwq/KWQTextField.mm:
  +        * kwq/KWQTimer.mm:
  +        * kwq/KWQValueListImpl.h:
  +        * kwq/KWQValueListImpl.mm:
  +        * kwq/WebCoreBridge.mm:
  +        * kwq/WebCoreCookieAdapter.m:
  +        * kwq/WebCoreGraphicsBridge.m:
  +        * kwq/WebCoreImageRendererFactory.m:
  +        * kwq/WebCoreKeyGenerator.m:
  +        * kwq/WebCoreTextRendererFactory.mm:
  +        * kwq/WebCoreViewFactory.m:
  +
   2005-09-26  Eric Seidel  <eseidel at apple.com>
   
           No review needed, svg build fix only.
  
  
  
  1.1                  WebCore/ForwardingHeaders/kxmlcore/Assertions.h
  
  Index: Assertions.h
  ===================================================================
  #import <JavaScriptCore/Assertions.h>
  
  
  
  1.1                  WebCore/ForwardingHeaders/kxmlcore/FastMalloc.h
  
  Index: FastMalloc.h
  ===================================================================
  #import <JavaScriptCore/FastMalloc.h>
  
  
  
  1.1                  WebCore/ForwardingHeaders/kxmlcore/SharedPtr.h
  
  Index: SharedPtr.h
  ===================================================================
  #import <JavaScriptCore/SharedPtr.h>
  
  
  
  1.29      +2 -26     WebCore/WebCore.xcodeproj/project.pbxproj
  
  Index: project.pbxproj
  ===================================================================
  RCS file: /cvs/root/WebCore/WebCore.xcodeproj/project.pbxproj,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- project.pbxproj	24 Sep 2005 05:49:15 -0000	1.28
  +++ project.pbxproj	27 Sep 2005 22:36:58 -0000	1.29
  @@ -166,7 +166,6 @@
   		93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* xml_tokenizer.h */; };
   		93F1992208245E59001E9ABC /* KWQApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867602DE3B8601EA4122 /* KWQApplication.h */; };
   		93F1992308245E59001E9ABC /* KWQArrayImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784C502DE375801EA4122 /* KWQArrayImpl.h */; };
  -		93F1992408245E59001E9ABC /* KWQAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377FB55032C235C008635CE /* KWQAssertions.h */; };
   		93F1992508245E59001E9ABC /* KWQAsyncIO.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867902DE3B8601EA4122 /* KWQAsyncIO.h */; };
   		93F1992608245E59001E9ABC /* KWQBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867B02DE3B8601EA4122 /* KWQBrush.h */; };
   		93F1992708245E59001E9ABC /* KWQBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867C02DE3B8601EA4122 /* KWQBuffer.h */; };
  @@ -373,7 +372,6 @@
   		93F199F908245E59001E9ABC /* html_interchange.h in Headers */ = {isa = PBXBuildFile; fileRef = BEA5E01D075CEDAC0098A432 /* html_interchange.h */; };
   		93F199FA08245E59001E9ABC /* markup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9378D9FA07640A46004B97BF /* markup.h */; };
   		93F199FB08245E59001E9ABC /* edit_actions.h in Headers */ = {isa = PBXBuildFile; fileRef = EDA4AC97076FB89100DD23EC /* edit_actions.h */; };
  -		93F199FC08245E59001E9ABC /* main_thread_malloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 65FD9D2C081D727F00636F54 /* main_thread_malloc.h */; };
   		93F199FE08245E59001E9ABC /* linkCursor.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F5A1B04902DE8ABA018635CA /* linkCursor.tiff */; };
   		93F199FF08245E59001E9ABC /* html4.css in Resources */ = {isa = PBXBuildFile; fileRef = F5A1B05302DE8B46018635CA /* html4.css */; };
   		93F19A0008245E59001E9ABC /* quirks.css in Resources */ = {isa = PBXBuildFile; fileRef = BC8F62990405F45600A80004 /* quirks.css */; };
  @@ -549,7 +547,6 @@
   		93F19AC708245E59001E9ABC /* KWQNSViewExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = F583D50203140623018635CE /* KWQNSViewExtras.m */; };
   		93F19AC808245E59001E9ABC /* WebCoreHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F5517DC3031AB56301A80180 /* WebCoreHistory.m */; };
   		93F19AC908245E59001E9ABC /* render_layer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F690CFEB031C47F401CA2AC4 /* render_layer.cpp */; };
  -		93F19ACA08245E59001E9ABC /* KWQAssertions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9377FB56032C235C008635CE /* KWQAssertions.m */; };
   		93F19ACB08245E59001E9ABC /* KWQLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 93861DE0032C2E52008635CE /* KWQLogging.m */; };
   		93F19ACC08245E59001E9ABC /* KWQFileButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93CCF7D5033BD43C008635CE /* KWQFileButton.mm */; };
   		93F19ACD08245E59001E9ABC /* KWQResourceLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93386B91037045B3008635CE /* KWQResourceLoader.mm */; };
  @@ -616,7 +613,6 @@
   		93F19B0E08245E59001E9ABC /* html_interchange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA5DBDA075CEDA00098A432 /* html_interchange.cpp */; };
   		93F19B0F08245E59001E9ABC /* markup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9378D9F907640A46004B97BF /* markup.cpp */; };
   		93F19B1008245E59001E9ABC /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51111AC007BD812C00B7162C /* DOMUtility.mm */; };
  -		93F19B1108245E59001E9ABC /* main_thread_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FD9D2B081D727F00636F54 /* main_thread_malloc.cpp */; };
   		93F19B1308245E59001E9ABC /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869302846DCD018635CA /* ApplicationServices.framework */; };
   		93F19B1408245E59001E9ABC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869402846DCD018635CA /* Carbon.framework */; };
   		93F19B1508245E59001E9ABC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C2869502846DCD018635CA /* Cocoa.framework */; };
  @@ -976,7 +972,6 @@
   		A8212AEC08794A2300677359 /* xml_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* xml_tokenizer.h */; };
   		A8212AED08794A2300677359 /* KWQApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867602DE3B8601EA4122 /* KWQApplication.h */; };
   		A8212AEE08794A2300677359 /* KWQArrayImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784C502DE375801EA4122 /* KWQArrayImpl.h */; };
  -		A8212AEF08794A2300677359 /* KWQAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377FB55032C235C008635CE /* KWQAssertions.h */; };
   		A8212AF008794A2300677359 /* KWQAsyncIO.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867902DE3B8601EA4122 /* KWQAsyncIO.h */; };
   		A8212AF108794A2300677359 /* KWQBrush.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867B02DE3B8601EA4122 /* KWQBrush.h */; };
   		A8212AF208794A2300677359 /* KWQBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = F587867C02DE3B8601EA4122 /* KWQBuffer.h */; };
  @@ -1183,7 +1178,6 @@
   		A8212BBF08794A2300677359 /* html_interchange.h in Headers */ = {isa = PBXBuildFile; fileRef = BEA5E01D075CEDAC0098A432 /* html_interchange.h */; };
   		A8212BC008794A2300677359 /* markup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9378D9FA07640A46004B97BF /* markup.h */; };
   		A8212BC108794A2300677359 /* edit_actions.h in Headers */ = {isa = PBXBuildFile; fileRef = EDA4AC97076FB89100DD23EC /* edit_actions.h */; };
  -		A8212BC208794A2300677359 /* main_thread_malloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 65FD9D2C081D727F00636F54 /* main_thread_malloc.h */; };
   		A8212BC308794A2300677359 /* edit_command.h in Headers */ = {isa = PBXBuildFile; fileRef = 654D87B60831973B0082DCA1 /* edit_command.h */; };
   		A8212BC408794A2300677359 /* composite_edit_command.h in Headers */ = {isa = PBXBuildFile; fileRef = 65DC16C30831DD6F0022744E /* composite_edit_command.h */; };
   		A8212BC508794A2300677359 /* append_node_command.h in Headers */ = {isa = PBXBuildFile; fileRef = 65AC79A00831ED6D009385CE /* append_node_command.h */; };
  @@ -1393,7 +1387,6 @@
   		A8212C9808794A2300677359 /* KWQNSViewExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = F583D50203140623018635CE /* KWQNSViewExtras.m */; };
   		A8212C9908794A2300677359 /* WebCoreHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F5517DC3031AB56301A80180 /* WebCoreHistory.m */; };
   		A8212C9A08794A2300677359 /* render_layer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F690CFEB031C47F401CA2AC4 /* render_layer.cpp */; };
  -		A8212C9B08794A2300677359 /* KWQAssertions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9377FB56032C235C008635CE /* KWQAssertions.m */; };
   		A8212C9C08794A2300677359 /* KWQLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = 93861DE0032C2E52008635CE /* KWQLogging.m */; };
   		A8212C9D08794A2300677359 /* KWQFileButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93CCF7D5033BD43C008635CE /* KWQFileButton.mm */; };
   		A8212C9E08794A2300677359 /* KWQResourceLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93386B91037045B3008635CE /* KWQResourceLoader.mm */; };
  @@ -1460,7 +1453,6 @@
   		A8212CDC08794A2300677359 /* html_interchange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA5DBDA075CEDA00098A432 /* html_interchange.cpp */; };
   		A8212CDD08794A2300677359 /* markup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9378D9F907640A46004B97BF /* markup.cpp */; };
   		A8212CDE08794A2300677359 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51111AC007BD812C00B7162C /* DOMUtility.mm */; };
  -		A8212CDF08794A2300677359 /* main_thread_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FD9D2B081D727F00636F54 /* main_thread_malloc.cpp */; };
   		A8212CE008794A2300677359 /* edit_command.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 654D87B50831973B0082DCA1 /* edit_command.cpp */; };
   		A8212CE108794A2300677359 /* composite_edit_command.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DC16C20831DD6F0022744E /* composite_edit_command.cpp */; };
   		A8212CE208794A2300677359 /* append_node_command.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65AC799F0831ED6D009385CE /* append_node_command.cpp */; };
  @@ -2463,8 +2455,6 @@
   		65F378270870D958000B2F94 /* hashtable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = hashtable.cpp; sourceTree = "<group>"; };
   		65F378280870D958000B2F94 /* hashtable.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hashtable.h; sourceTree = "<group>"; };
   		65F80697054D9F86008BF776 /* KWQExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQExceptions.mm; sourceTree = "<group>"; };
  -		65FD9D2B081D727F00636F54 /* main_thread_malloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main_thread_malloc.cpp; sourceTree = "<group>"; };
  -		65FD9D2C081D727F00636F54 /* main_thread_malloc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = main_thread_malloc.h; sourceTree = "<group>"; };
   		7E6FEED60898582300C44C3F /* WebCoreScriptDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreScriptDebugger.h; sourceTree = "<group>"; };
   		7E6FEED70898582300C44C3F /* WebCoreScriptDebugger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreScriptDebugger.mm; sourceTree = "<group>"; };
   		832556E4061DF155007B8054 /* DOMExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMExtensions.h; sourceTree = "<group>"; };
  @@ -2506,8 +2496,6 @@
   		93386B91037045B3008635CE /* KWQResourceLoader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQResourceLoader.mm; sourceTree = "<group>"; };
   		9348900506C00363007E7ACE /* DOMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMPrivate.h; sourceTree = "<group>"; };
   		934E43780414294A008635CE /* parser.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = parser.y; sourceTree = "<group>"; };
  -		9377FB55032C235C008635CE /* KWQAssertions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQAssertions.h; sourceTree = "<group>"; };
  -		9377FB56032C235C008635CE /* KWQAssertions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = KWQAssertions.m; sourceTree = "<group>"; };
   		9378D9F907640A46004B97BF /* markup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = markup.cpp; path = editing/markup.cpp; sourceTree = "<group>"; };
   		9378D9FA07640A46004B97BF /* markup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = markup.h; path = editing/markup.h; sourceTree = "<group>"; };
   		93859E32065FCAD300CF54EE /* DOMHTMLInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHTMLInternal.h; sourceTree = "<group>"; };
  @@ -3829,8 +3817,8 @@
   		A8C0FB8C089701F800BA5114 /* KCanvasTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasTypes.h; sourceTree = "<group>"; };
   		A8C0FB8D089701F800BA5114 /* KCanvasView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasView.cpp; sourceTree = "<group>"; };
   		A8C0FB8E089701F800BA5114 /* KCanvasView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasView.h; sourceTree = "<group>"; };
  -		A8DC63E808E0DD0A004507F7 /* EcmaInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EcmaInterface.cpp; path = "kdom/ecma/EcmaInterface.cpp"; sourceTree = DERIVED_FILE_DIR; };
  -		A8DC63EB08E0DD2A004507F7 /* EcmaInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EcmaInterface.cpp; path = "ksvg2/ecma/EcmaInterface.cpp"; sourceTree = DERIVED_FILE_DIR; };
  +		A8DC63E808E0DD0A004507F7 /* EcmaInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EcmaInterface.cpp; path = kdom/ecma/EcmaInterface.cpp; sourceTree = DERIVED_FILE_DIR; };
  +		A8DC63EB08E0DD2A004507F7 /* EcmaInterface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EcmaInterface.cpp; path = ksvg2/ecma/EcmaInterface.cpp; sourceTree = DERIVED_FILE_DIR; };
   		A8EA433D08E14EAB004BC396 /* xml_kdomtokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xml_kdomtokenizer.h; sourceTree = "<group>"; };
   		A8EA433E08E14EAC004BC396 /* xml_kdomtokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xml_kdomtokenizer.cpp; sourceTree = "<group>"; };
   		A8EA433F08E14EAC004BC396 /* render_kcanvaswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render_kcanvaswrapper.h; sourceTree = "<group>"; };
  @@ -6270,8 +6258,6 @@
   		F523D15002DE4271018635CA /* other */ = {
   			isa = PBXGroup;
   			children = (
  -				9377FB55032C235C008635CE /* KWQAssertions.h */,
  -				9377FB56032C235C008635CE /* KWQAssertions.m */,
   				F58784CC02DE375901EA4122 /* KWQCharsets.h */,
   				F5BFAAC10309CDF6018635CE /* character-sets.txt */,
   				F550D70B02E13281018635CA /* mac-encodings.txt */,
  @@ -6494,8 +6480,6 @@
   				F523D28402DE43D7018635CA /* loader_client.h */,
   				F523D28502DE43D7018635CA /* loader.cpp */,
   				F523D28602DE43D7018635CA /* loader.h */,
  -				65FD9D2B081D727F00636F54 /* main_thread_malloc.cpp */,
  -				65FD9D2C081D727F00636F54 /* main_thread_malloc.h */,
   				F523D28802DE43D7018635CA /* shared.h */,
   				BC433ACF05D3046F003A5A14 /* stringit.cpp */,
   				F523D28902DE43D7018635CA /* stringit.h */,
  @@ -7033,7 +7017,6 @@
   				93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */,
   				93F1992208245E59001E9ABC /* KWQApplication.h in Headers */,
   				93F1992308245E59001E9ABC /* KWQArrayImpl.h in Headers */,
  -				93F1992408245E59001E9ABC /* KWQAssertions.h in Headers */,
   				93F1992508245E59001E9ABC /* KWQAsyncIO.h in Headers */,
   				93F1992608245E59001E9ABC /* KWQBrush.h in Headers */,
   				93F1992708245E59001E9ABC /* KWQBuffer.h in Headers */,
  @@ -7243,7 +7226,6 @@
   				93F199F908245E59001E9ABC /* html_interchange.h in Headers */,
   				93F199FA08245E59001E9ABC /* markup.h in Headers */,
   				93F199FB08245E59001E9ABC /* edit_actions.h in Headers */,
  -				93F199FC08245E59001E9ABC /* main_thread_malloc.h in Headers */,
   				654D87B80831973B0082DCA1 /* edit_command.h in Headers */,
   				65DC16C50831DD6F0022744E /* composite_edit_command.h in Headers */,
   				65AC79A20831ED6D009385CE /* append_node_command.h in Headers */,
  @@ -7381,7 +7363,6 @@
   				A8212AEC08794A2300677359 /* xml_tokenizer.h in Headers */,
   				A8212AED08794A2300677359 /* KWQApplication.h in Headers */,
   				A8212AEE08794A2300677359 /* KWQArrayImpl.h in Headers */,
  -				A8212AEF08794A2300677359 /* KWQAssertions.h in Headers */,
   				A8212AF008794A2300677359 /* KWQAsyncIO.h in Headers */,
   				A8212AF108794A2300677359 /* KWQBrush.h in Headers */,
   				A8212AF208794A2300677359 /* KWQBuffer.h in Headers */,
  @@ -7591,7 +7572,6 @@
   				A8212BBF08794A2300677359 /* html_interchange.h in Headers */,
   				A8212BC008794A2300677359 /* markup.h in Headers */,
   				A8212BC108794A2300677359 /* edit_actions.h in Headers */,
  -				A8212BC208794A2300677359 /* main_thread_malloc.h in Headers */,
   				A8212BC308794A2300677359 /* edit_command.h in Headers */,
   				A8212BC408794A2300677359 /* composite_edit_command.h in Headers */,
   				A8212BC508794A2300677359 /* append_node_command.h in Headers */,
  @@ -9483,7 +9463,6 @@
   				93F19AC708245E59001E9ABC /* KWQNSViewExtras.m in Sources */,
   				93F19AC808245E59001E9ABC /* WebCoreHistory.m in Sources */,
   				93F19AC908245E59001E9ABC /* render_layer.cpp in Sources */,
  -				93F19ACA08245E59001E9ABC /* KWQAssertions.m in Sources */,
   				93F19ACB08245E59001E9ABC /* KWQLogging.m in Sources */,
   				93F19ACC08245E59001E9ABC /* KWQFileButton.mm in Sources */,
   				93F19ACD08245E59001E9ABC /* KWQResourceLoader.mm in Sources */,
  @@ -9550,7 +9529,6 @@
   				93F19B0E08245E59001E9ABC /* html_interchange.cpp in Sources */,
   				93F19B0F08245E59001E9ABC /* markup.cpp in Sources */,
   				93F19B1008245E59001E9ABC /* DOMUtility.mm in Sources */,
  -				93F19B1108245E59001E9ABC /* main_thread_malloc.cpp in Sources */,
   				654D87B70831973B0082DCA1 /* edit_command.cpp in Sources */,
   				65DC16C40831DD6F0022744E /* composite_edit_command.cpp in Sources */,
   				65AC79A10831ED6D009385CE /* append_node_command.cpp in Sources */,
  @@ -9757,7 +9735,6 @@
   				A8212C9808794A2300677359 /* KWQNSViewExtras.m in Sources */,
   				A8212C9908794A2300677359 /* WebCoreHistory.m in Sources */,
   				A8212C9A08794A2300677359 /* render_layer.cpp in Sources */,
  -				A8212C9B08794A2300677359 /* KWQAssertions.m in Sources */,
   				A8212C9C08794A2300677359 /* KWQLogging.m in Sources */,
   				A8212C9D08794A2300677359 /* KWQFileButton.mm in Sources */,
   				A8212C9E08794A2300677359 /* KWQResourceLoader.mm in Sources */,
  @@ -9824,7 +9801,6 @@
   				A8212CDC08794A2300677359 /* html_interchange.cpp in Sources */,
   				A8212CDD08794A2300677359 /* markup.cpp in Sources */,
   				A8212CDE08794A2300677359 /* DOMUtility.mm in Sources */,
  -				A8212CDF08794A2300677359 /* main_thread_malloc.cpp in Sources */,
   				A8212CE008794A2300677359 /* edit_command.cpp in Sources */,
   				A8212CE108794A2300677359 /* composite_edit_command.cpp in Sources */,
   				A8212CE208794A2300677359 /* append_node_command.cpp in Sources */,
  
  
  
  1.60      +2 -2      WebCore/khtml/khtmlpart_p.h
  
  Index: khtmlpart_p.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/khtmlpart_p.h,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- khtmlpart_p.h	24 Sep 2005 01:18:52 -0000	1.59
  +++ khtmlpart_p.h	27 Sep 2005 22:37:01 -0000	1.60
  @@ -245,7 +245,7 @@
     long m_cacheId;
   #endif
     QString scheduledScript;
  -  khtml::SharedPtr<DOM::NodeImpl> scheduledScriptNode;
  +  SharedPtr<DOM::NodeImpl> scheduledScriptNode;
   
     KJSProxy *m_jscript;
     KLibrary *m_kjs_lib;
  @@ -363,7 +363,7 @@
     SubmitForm *m_submitForm;
   
     bool m_bMousePressed;
  -  khtml::SharedPtr<DOM::NodeImpl> m_mousePressNode; //node under the mouse when the mouse was pressed (set in the mouse handler)
  +  SharedPtr<DOM::NodeImpl> m_mousePressNode; //node under the mouse when the mouse was pressed (set in the mouse handler)
   
     khtml::ETextGranularity m_selectionGranularity;
     bool m_beganSelectingText;
  
  
  
  1.17      +3 -9      WebCore/khtml/css/css_base.h
  
  Index: css_base.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/css_base.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- css_base.h	16 Sep 2005 22:42:01 -0000	1.16
  +++ css_base.h	27 Sep 2005 22:37:01 -0000	1.17
  @@ -46,13 +46,11 @@
   
       class DocumentImpl;
   
  -    struct CSSNamespace {
  +    struct CSSNamespace : public FastAllocated {
           AtomicString m_prefix;
           AtomicString m_uri;
           CSSNamespace* m_parent;
   
  -        MAIN_THREAD_ALLOCATED;
  -
           CSSNamespace(const AtomicString& p, const AtomicString& u, CSSNamespace* parent) 
               :m_prefix(p), m_uri(u), m_parent(parent) {}
           ~CSSNamespace() { delete m_parent; }
  @@ -70,7 +68,7 @@
       };
       
   // this class represents a selector for a StyleRule
  -    class CSSSelector
  +    class CSSSelector : public FastAllocated
       {
       public:
           CSSSelector()
  @@ -91,8 +89,6 @@
               delete nextSelector;
   	}
   
  -        MAIN_THREAD_ALLOCATED;
  -
           void append(CSSSelector* n) {
               if (!nextSelector) nextSelector = n; else nextSelector->append(n);
           }
  @@ -198,7 +194,7 @@
       };
   
       // a style class which has a parent (almost all have)
  -    class StyleBaseImpl : public khtml::TreeShared<StyleBaseImpl>
  +    class StyleBaseImpl : public khtml::TreeShared<StyleBaseImpl>, public FastAllocated
       {
       public:
   	StyleBaseImpl()  { m_parent = 0; strictParsing = true; multiLength = false; }
  @@ -210,8 +206,6 @@
   
   	virtual ~StyleBaseImpl() {}
   
  -        MAIN_THREAD_ALLOCATED;
  -
   	// returns the url of the style sheet this object belongs to
   	DOMString baseURL();
   
  
  
  
  1.37      +1 -1      WebCore/khtml/css/css_computedstyle.cpp
  
  Index: css_computedstyle.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/css_computedstyle.cpp,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- css_computedstyle.cpp	16 Sep 2005 22:42:01 -0000	1.36
  +++ css_computedstyle.cpp	27 Sep 2005 22:37:01 -0000	1.37
  @@ -34,7 +34,7 @@
   #include "rendering/render_object.h"
   
   #if APPLE_CHANGES
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFontFamily.h"
   #import "KWQLogging.h"
   #endif
  
  
  
  1.18      +2 -20     WebCore/khtml/css/css_ruleimpl.h
  
  Index: css_ruleimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/css_ruleimpl.h,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- css_ruleimpl.h	16 Sep 2005 22:42:01 -0000	1.17
  +++ css_ruleimpl.h	27 Sep 2005 22:37:01 -0000	1.18
  @@ -20,7 +20,7 @@
    * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    * Boston, MA 02111-1307, USA.
    *
  - * $Id: css_ruleimpl.h,v 1.17 2005/09/16 22:42:01 adele Exp $
  + * $Id: css_ruleimpl.h,v 1.18 2005/09/27 22:37:01 mjs Exp $
    */
   #ifndef _CSS_css_ruleimpl_h_
   #define _CSS_css_ruleimpl_h_
  @@ -30,7 +30,7 @@
   #include "css/css_base.h"
   #include "misc/loader_client.h"
   #include "misc/shared.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "css_valueimpl.h"
   
   namespace khtml {
  @@ -51,8 +51,6 @@
       CSSRuleImpl(StyleBaseImpl *parent)
           : StyleBaseImpl(parent), m_type(CSSRule::UNKNOWN_RULE) {}
   
  -    MAIN_THREAD_ALLOCATED;
  -
       virtual bool isRule() { return true; }
       unsigned short type() const { return m_type; }
   
  @@ -74,8 +72,6 @@
       CSSCharsetRuleImpl(StyleBaseImpl *parent)
           : CSSRuleImpl(parent) { m_type = CSSRule::CHARSET_RULE; }
   
  -    MAIN_THREAD_ALLOCATED;
  -
       virtual bool isCharsetRule() { return true; }
       virtual DOMString cssText() const;
   
  @@ -93,8 +89,6 @@
       CSSFontFaceRuleImpl(StyleBaseImpl *parent);
       virtual ~CSSFontFaceRuleImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       CSSMutableStyleDeclarationImpl *style() const { return m_style; }
   
       virtual bool isFontFaceRule() { return true; }
  @@ -113,8 +107,6 @@
                          MediaListImpl *media );
       virtual ~CSSImportRuleImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       DOM::DOMString href() const { return m_strHref; }
       MediaListImpl *media() const { return m_lstMedia; }
       CSSStyleSheetImpl *styleSheet() const { return m_styleSheet; }
  @@ -145,8 +137,6 @@
       CSSRuleListImpl(StyleListImpl *);
       ~CSSRuleListImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       unsigned length() const { return m_lstCSSRules.count(); }
       CSSRuleImpl *item ( unsigned index ) { return m_lstCSSRules.at( index ); }
   
  @@ -167,8 +157,6 @@
       CSSMediaRuleImpl( StyleBaseImpl *parent, MediaListImpl *mediaList, CSSRuleListImpl *ruleList );
       virtual ~CSSMediaRuleImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       MediaListImpl *media() const { return m_lstMedia; }
       CSSRuleListImpl *cssRules() { return m_lstCSSRules; }
   
  @@ -192,8 +180,6 @@
       CSSPageRuleImpl(StyleBaseImpl *parent);
       virtual ~CSSPageRuleImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       CSSMutableStyleDeclarationImpl *style() const { return m_style; }
   
       virtual bool isPageRule() { return true; }
  @@ -213,8 +199,6 @@
       CSSStyleRuleImpl(StyleBaseImpl *parent);
       virtual ~CSSStyleRuleImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       CSSMutableStyleDeclarationImpl *style() const { return m_style; }
   
       virtual bool isStyleRule() { return true; }
  @@ -241,8 +225,6 @@
   public:
       CSSUnknownRuleImpl(StyleBaseImpl *parent) : CSSRuleImpl(parent) {}
   
  -    MAIN_THREAD_ALLOCATED;
  -
       virtual bool isUnknownRule() { return true; }
   };
   
  
  
  
  1.50      +4 -16     WebCore/khtml/css/css_valueimpl.h
  
  Index: css_valueimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/css_valueimpl.h,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- css_valueimpl.h	16 Sep 2005 22:42:02 -0000	1.49
  +++ css_valueimpl.h	27 Sep 2005 22:37:01 -0000	1.50
  @@ -238,10 +238,8 @@
       virtual bool isQuirkValue() { return true; }
   };
   
  -class CounterImpl : public khtml::Shared<CounterImpl> {
  +class CounterImpl : public khtml::Shared<CounterImpl>, public FastAllocated {
   public:
  -    MAIN_THREAD_ALLOCATED;
  -
       DOMString identifier() const { return m_identifier; }
       DOMString listStyle() const { return m_listStyle; }
       DOMString separator() const { return m_separator; }
  @@ -251,13 +249,11 @@
       DOMString m_separator;
   };
   
  -class RectImpl : public khtml::Shared<RectImpl> {
  +class RectImpl : public khtml::Shared<RectImpl>, public FastAllocated {
   public:
       RectImpl();
       virtual ~RectImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       CSSPrimitiveValueImpl *top() const { return m_top; }
       CSSPrimitiveValueImpl *right() const { return m_right; }
       CSSPrimitiveValueImpl *bottom() const { return m_bottom; }
  @@ -278,13 +274,11 @@
   // and border-spacing (all of which are space-separated sets of two values).  At the moment we are only using it for
   // border-radius, but (FIXME) border-spacing and background-position could be converted over to use it
   // (eliminating some extra -khtml- internal properties).
  -class PairImpl : public khtml::Shared<PairImpl> {
  +class PairImpl : public khtml::Shared<PairImpl>, public FastAllocated {
   public:
       PairImpl();
       virtual ~PairImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       CSSPrimitiveValueImpl *first() const { return m_first; }
       CSSPrimitiveValueImpl *second() const { return m_second; }
   
  @@ -330,8 +324,6 @@
       CSSImageValueImpl(const DOMString &url, StyleBaseImpl *style);
       virtual ~CSSImageValueImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       khtml::CachedImage *image(khtml::DocLoader* loader);
   
   protected:
  @@ -347,8 +339,6 @@
                               int horizontalRule, int verticalRule);
       virtual ~CSSBorderImageValueImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       virtual DOMString cssText() const;
       virtual unsigned short cssValueType() const { return CSSValue::CSS_CUSTOM; }
   
  @@ -420,7 +410,7 @@
   // ------------------------------------------------------------------------------
   
   // another helper class
  -class CSSProperty
  +class CSSProperty : public FastAllocated
   {
   public:
       CSSProperty() : m_id(-1), m_bImportant(false), m_value(0)
  @@ -451,8 +441,6 @@
   	if(m_value) m_value->deref();
       }
   
  -    MAIN_THREAD_ALLOCATED;
  -
       void setValue(CSSValueImpl *val) {
   	if (val) val->ref();
           if (m_value) m_value->deref();
  
  
  
  1.37      +5 -13     WebCore/khtml/css/cssstyleselector.h
  
  Index: cssstyleselector.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/css/cssstyleselector.h,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- cssstyleselector.h	27 Aug 2005 00:14:19 -0000	1.36
  +++ cssstyleselector.h	27 Sep 2005 22:37:02 -0000	1.37
  @@ -29,7 +29,7 @@
   #include "rendering/render_style.h"
   #include "dom/dom_string.h"
   #include "css/css_ruleimpl.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   class KHTMLSettings;
   class KHTMLView;
  @@ -62,7 +62,7 @@
        * for specific implementations of the Selector. At the moment only CSSStyleSelector
        * exists, but someone may wish to implement XSL...
        */
  -    class StyleSelector
  +    class StyleSelector : public FastAllocated
       {
       public:
   	StyleSelector() {};
  @@ -73,8 +73,6 @@
   // 	virtual ~StyleSelector() {};
   // 	virtual RenderStyle *styleForElement(DOM::ElementImpl *e) = 0;
   
  -        MAIN_THREAD_ALLOCATED;
  -
   	enum State {
   	    None = 0x00,
   	    Hover = 0x01,
  @@ -226,14 +224,12 @@
   	void applyProperty(int id, DOM::CSSValueImpl *value);
       };
   
  -    class CSSRuleData {
  +    class CSSRuleData : public FastAllocated {
       public:
           CSSRuleData(uint pos, DOM::CSSStyleRuleImpl* r, DOM::CSSSelector* sel, CSSRuleData* prev = 0)
           :m_position(pos), m_rule(r), m_selector(sel), m_next(0) { if (prev) prev->m_next = this; }
           ~CSSRuleData() { delete m_next; }
   
  -        MAIN_THREAD_ALLOCATED;
  -
           uint position() { return m_position; }
           DOM::CSSStyleRuleImpl* rule() { return m_rule; }
           DOM::CSSSelector* selector() { return m_selector; }
  @@ -246,14 +242,12 @@
           CSSRuleData* m_next;
       };
   
  -    class CSSRuleDataList {
  +    class CSSRuleDataList : public FastAllocated {
       public:
           CSSRuleDataList(uint pos, DOM::CSSStyleRuleImpl* rule, DOM::CSSSelector* sel)
           { m_first = m_last = new CSSRuleData(pos, rule, sel); }
           ~CSSRuleDataList() { delete m_first; }
   
  -        MAIN_THREAD_ALLOCATED;
  -
           CSSRuleData* first() { return m_first; }
           CSSRuleData* last() { return m_last; }
           
  @@ -266,14 +260,12 @@
           CSSRuleData* m_last;
       };
       
  -    class CSSRuleSet
  +    class CSSRuleSet : public FastAllocated
       {
       public:
           CSSRuleSet();
           ~CSSRuleSet();
   
  -        MAIN_THREAD_ALLOCATED;
  -
           typedef HashMap<DOM::DOMStringImpl *, CSSRuleDataList *, PointerHash<DOM::DOMStringImpl *> > AtomRuleMap;
   
           void addRulesFromSheet(DOM::CSSStyleSheetImpl* sheet, const DOM::DOMString &medium = "screen");
  
  
  
  1.3       +1 -1      WebCore/khtml/ecma/domparser.h
  
  Index: domparser.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/domparser.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- domparser.h	8 Aug 2005 04:07:40 -0000	1.2
  +++ domparser.h	27 Sep 2005 22:37:03 -0000	1.3
  @@ -33,7 +33,7 @@
       virtual bool implementsConstruct() const;
       virtual ObjectImp *construct(ExecState *exec, const List &args);
   private:
  -    khtml::SharedPtr<DOM::DocumentImpl> doc;
  +    SharedPtr<DOM::DocumentImpl> doc;
     };
   
     class DOMParser : public DOMObject {
  
  
  
  1.20      +10 -10    WebCore/khtml/ecma/kjs_css.h
  
  Index: kjs_css.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_css.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- kjs_css.h	8 Aug 2005 04:07:40 -0000	1.19
  +++ kjs_css.h	27 Sep 2005 22:37:03 -0000	1.20
  @@ -63,7 +63,7 @@
       static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
       static ValueImp *cssPropertyGetter(ExecState *, const Identifier&, const PropertySlot&);
   
  -    khtml::SharedPtr<DOM::CSSStyleDeclarationImpl> m_impl;
  +    SharedPtr<DOM::CSSStyleDeclarationImpl> m_impl;
     };
   
     ValueImp *getDOMCSSStyleDeclaration(ExecState *exec, DOM::CSSStyleDeclarationImpl *d);
  @@ -84,7 +84,7 @@
       // Constructor for derived classes; doesn't set up a prototype.
       DOMStyleSheet(DOM::StyleSheetImpl *ss) : m_impl(ss) { }
     private:
  -    khtml::SharedPtr<DOM::StyleSheetImpl> m_impl;
  +    SharedPtr<DOM::StyleSheetImpl> m_impl;
     };
   
     ValueImp *getDOMStyleSheet(ExecState *exec, DOM::StyleSheetImpl *ss);
  @@ -106,8 +106,8 @@
       static ValueImp *indexGetter(ExecState *, const Identifier&, const PropertySlot&);
       static ValueImp *nameGetter(ExecState *, const Identifier&, const PropertySlot&);
   
  -    khtml::SharedPtr<DOM::StyleSheetListImpl> m_impl;
  -    khtml::SharedPtr<DOM::DocumentImpl> m_doc;
  +    SharedPtr<DOM::StyleSheetListImpl> m_impl;
  +    SharedPtr<DOM::DocumentImpl> m_doc;
     };
   
     // The document is only used for get-stylesheet-by-name (make optional if necessary)
  @@ -128,7 +128,7 @@
       DOM::MediaListImpl *impl() const { return m_impl.get(); }
     private:
       static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
  -    khtml::SharedPtr<DOM::MediaListImpl> m_impl;
  +    SharedPtr<DOM::MediaListImpl> m_impl;
     };
   
     ValueImp *getDOMMediaList(ExecState *exec, DOM::MediaListImpl *ml);
  @@ -159,7 +159,7 @@
     private:
       static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
   
  -    khtml::SharedPtr<DOM::CSSRuleListImpl> m_impl;
  +    SharedPtr<DOM::CSSRuleListImpl> m_impl;
     };
   
     ValueImp *getDOMCSSRuleList(ExecState *exec, DOM::CSSRuleListImpl *rl);
  @@ -181,7 +181,7 @@
              Import_Href, Import_Media, Import_StyleSheet, Charset_Encoding };
       DOM::CSSRuleImpl *impl() const { return m_impl.get(); }
     private:
  -    khtml::SharedPtr<DOM::CSSRuleImpl> m_impl;
  +    SharedPtr<DOM::CSSRuleImpl> m_impl;
     };
   
     ValueImp *getDOMCSSRule(ExecState *exec, DOM::CSSRuleImpl *r);
  @@ -215,7 +215,7 @@
       // Constructor for derived classes; doesn't set up a prototype.
       DOMCSSValue(DOM::CSSValueImpl *v) : m_impl(v) { }
     private:
  -    khtml::SharedPtr<DOM::CSSValueImpl> m_impl;
  +    SharedPtr<DOM::CSSValueImpl> m_impl;
     };
   
     ValueImp *getDOMCSSValue(ExecState *exec, DOM::CSSValueImpl *v);
  @@ -299,7 +299,7 @@
       static const ClassInfo info;
       enum { Top, Right, Bottom, Left };
     private:
  -    khtml::SharedPtr<DOM::RectImpl> m_rect;
  +    SharedPtr<DOM::RectImpl> m_rect;
     };
   
     ValueImp *getDOMRect(ExecState *exec, DOM::RectImpl *r);
  @@ -315,7 +315,7 @@
       static const ClassInfo info;
       enum { identifier, listStyle, separator };
     protected:
  -    khtml::SharedPtr<DOM::CounterImpl> m_counter;
  +    SharedPtr<DOM::CounterImpl> m_counter;
     };
   
     ValueImp *getDOMCounter(ExecState *exec, DOM::CounterImpl *c);
  
  
  
  1.98      +0 -1      WebCore/khtml/ecma/kjs_dom.cpp
  
  Index: kjs_dom.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.cpp,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- kjs_dom.cpp	22 Sep 2005 19:19:56 -0000	1.97
  +++ kjs_dom.cpp	27 Sep 2005 22:37:03 -0000	1.98
  @@ -80,7 +80,6 @@
   using DOM::TextImpl;
   
   using khtml::RenderObject;
  -using khtml::SharedPtr;
   
   #include "kjs_dom.lut.h"
   
  
  
  
  1.50      +6 -6      WebCore/khtml/ecma/kjs_dom.h
  
  Index: kjs_dom.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_dom.h,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- kjs_dom.h	31 Aug 2005 04:38:36 -0000	1.49
  +++ kjs_dom.h	27 Sep 2005 22:37:03 -0000	1.50
  @@ -82,7 +82,7 @@
     protected:
       // Constructor for inherited classes; doesn't set up a prototype.
       DOMNode(DOM::NodeImpl *n);
  -    khtml::SharedPtr<DOM::NodeImpl> m_impl;
  +    SharedPtr<DOM::NodeImpl> m_impl;
     };
   
     DOM::NodeImpl *toNode(ValueImp *); // returns 0 if passed-in value is not a DOMNode object
  @@ -108,7 +108,7 @@
       static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
       static ValueImp *nameGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
   
  -    khtml::SharedPtr<DOM::NodeListImpl> m_impl;
  +    SharedPtr<DOM::NodeListImpl> m_impl;
     };
   
     class DOMDocument : public DOMNode {
  @@ -187,7 +187,7 @@
       enum { HasFeature, CreateDocumentType, CreateDocument, CreateCSSStyleSheet, CreateHTMLDocument };
       DOM::DOMImplementationImpl *impl() const { return m_impl.get(); }
     private:
  -    khtml::SharedPtr<DOM::DOMImplementationImpl> m_impl;
  +    SharedPtr<DOM::DOMImplementationImpl> m_impl;
     };
   
     class DOMDocumentType : public DOMNode {
  @@ -219,7 +219,7 @@
       static ValueImp *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
       static ValueImp *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
   
  -    khtml::SharedPtr<DOM::NamedNodeMapImpl> m_impl;
  +    SharedPtr<DOM::NamedNodeMapImpl> m_impl;
     };
   
     class DOMProcessingInstruction : public DOMNode {
  @@ -291,13 +291,13 @@
     // when multiple nodes have the same name.
     class DOMNamedNodesCollection : public DOMObject {
     public:
  -    DOMNamedNodesCollection(ExecState *exec, const QValueList< khtml::SharedPtr<DOM::NodeImpl> >& nodes );
  +    DOMNamedNodesCollection(ExecState *exec, const QValueList< SharedPtr<DOM::NodeImpl> >& nodes );
       virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
     private:
       static ValueImp *lengthGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
       static ValueImp *indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot);
   
  -    QValueList< khtml::SharedPtr<DOM::NodeImpl> > m_nodes;
  +    QValueList< SharedPtr<DOM::NodeImpl> > m_nodes;
     };
   
     class DOMCharacterData : public DOMNode {
  
  
  
  1.34      +1 -1      WebCore/khtml/ecma/kjs_events.h
  
  Index: kjs_events.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_events.h,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- kjs_events.h	19 Sep 2005 18:52:10 -0000	1.33
  +++ kjs_events.h	27 Sep 2005 22:37:03 -0000	1.34
  @@ -127,7 +127,7 @@
   	   SrcElement, ReturnValue, CancelBubble, ClipboardData, DataTransfer };
       DOM::EventImpl *impl() const { return m_impl.get(); }
     protected:
  -    khtml::SharedPtr<DOM::EventImpl> m_impl;
  +    SharedPtr<DOM::EventImpl> m_impl;
       mutable Clipboard *clipboard;
     };
   
  
  
  
  1.140     +0 -1      WebCore/khtml/ecma/kjs_html.cpp
  
  Index: kjs_html.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.cpp,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- kjs_html.cpp	16 Sep 2005 22:42:05 -0000	1.139
  +++ kjs_html.cpp	27 Sep 2005 22:37:03 -0000	1.140
  @@ -134,7 +134,6 @@
   using DOM::TextImpl;
   
   using khtml::RenderCanvasImage;
  -using khtml::SharedPtr;
   
   #include "kjs_html.lut.h"
   
  
  
  
  1.56      +5 -5      WebCore/khtml/ecma/kjs_html.h
  
  Index: kjs_html.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_html.h,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- kjs_html.h	8 Aug 2005 04:07:41 -0000	1.55
  +++ kjs_html.h	27 Sep 2005 22:37:04 -0000	1.56
  @@ -314,7 +314,7 @@
       static const ClassInfo info;
       DOM::HTMLCollectionImpl *impl() const { return m_impl.get(); }
     protected:
  -    khtml::SharedPtr<DOM::HTMLCollectionImpl> m_impl;
  +    SharedPtr<DOM::HTMLCollectionImpl> m_impl;
     private:
       static ValueImp *lengthGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
       static ValueImp *indexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
  @@ -329,7 +329,7 @@
     private:
       static ValueImp *selectedIndexGetter(ExecState *exec, const Identifier&, const PropertySlot& slot);
   
  -    khtml::SharedPtr<DOM::HTMLSelectElementImpl> m_element;
  +    SharedPtr<DOM::HTMLSelectElementImpl> m_element;
     };
   
     ////////////////////// Option Object ////////////////////////
  @@ -340,7 +340,7 @@
       virtual bool implementsConstruct() const;
       virtual ObjectImp *construct(ExecState *exec, const List &args);
     private:
  -    khtml::SharedPtr<DOM::DocumentImpl> m_doc;
  +    SharedPtr<DOM::DocumentImpl> m_doc;
     };
   
     ////////////////////// Image Object ////////////////////////
  @@ -351,7 +351,7 @@
       virtual bool implementsConstruct() const;
       virtual ObjectImp *construct(ExecState *exec, const List &args);
     private:
  -    khtml::SharedPtr<DOM::DocumentImpl> m_doc;
  +    SharedPtr<DOM::DocumentImpl> m_doc;
     };
   
     class Image : public DOMObject, public khtml::CachedObjectClient {
  @@ -440,7 +440,7 @@
       
       void setShadow(ExecState *exec);
   
  -    khtml::SharedPtr<DOM::HTMLElementImpl> _element;
  +    SharedPtr<DOM::HTMLElementImpl> _element;
       bool _needsFlushRasterCache;
       
       QPtrList<List> stateStack;
  
  
  
  1.10      +1 -1      WebCore/khtml/ecma/kjs_range.h
  
  Index: kjs_range.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_range.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- kjs_range.h	8 Aug 2005 04:07:41 -0000	1.9
  +++ kjs_range.h	27 Sep 2005 22:37:04 -0000	1.10
  @@ -47,7 +47,7 @@
              Detach, CreateContextualFragment };
       DOM::RangeImpl *impl() const { return m_impl.get(); }
     private:
  -    khtml::SharedPtr<DOM::RangeImpl> m_impl;
  +    SharedPtr<DOM::RangeImpl> m_impl;
   };
   
     // Constructor object Range
  
  
  
  1.12      +3 -3      WebCore/khtml/ecma/kjs_traversal.h
  
  Index: kjs_traversal.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_traversal.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- kjs_traversal.h	19 Sep 2005 18:52:11 -0000	1.11
  +++ kjs_traversal.h	27 Sep 2005 22:37:04 -0000	1.12
  @@ -46,7 +46,7 @@
              NextNode, PreviousNode, Detach };
       DOM::NodeIteratorImpl *impl() const { return m_impl.get(); }
     private:
  -    khtml::SharedPtr<DOM::NodeIteratorImpl> m_impl;
  +    SharedPtr<DOM::NodeIteratorImpl> m_impl;
     };
   
     // Constructor object NodeFilter
  @@ -70,7 +70,7 @@
       DOM::NodeFilterImpl *impl() const { return m_impl.get(); }
       enum { AcceptNode };
     private:
  -    khtml::SharedPtr<DOM::NodeFilterImpl> m_impl;
  +    SharedPtr<DOM::NodeFilterImpl> m_impl;
     };
   
     class DOMTreeWalker : public DOMObject {
  @@ -87,7 +87,7 @@
              PreviousNode, NextNode };
       DOM::TreeWalkerImpl *impl() const { return m_impl.get(); }
     private:
  -    khtml::SharedPtr<DOM::TreeWalkerImpl> m_impl;
  +    SharedPtr<DOM::TreeWalkerImpl> m_impl;
     };
   
     ValueImp *getDOMNodeIterator(ExecState *exec, DOM::NodeIteratorImpl *ni);
  
  
  
  1.13      +0 -1      WebCore/khtml/ecma/kjs_views.cpp
  
  Index: kjs_views.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- kjs_views.cpp	29 Aug 2005 21:29:13 -0000	1.12
  +++ kjs_views.cpp	27 Sep 2005 22:37:04 -0000	1.13
  @@ -32,7 +32,6 @@
   using DOM::ElementImpl;
   using DOM::NodeImpl;
   
  -using khtml::SharedPtr;
   
   #include "kjs_views.lut.h"
   
  
  
  
  1.9       +1 -1      WebCore/khtml/ecma/kjs_views.h
  
  Index: kjs_views.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_views.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- kjs_views.h	8 Aug 2005 04:07:41 -0000	1.8
  +++ kjs_views.h	27 Sep 2005 22:37:04 -0000	1.9
  @@ -41,7 +41,7 @@
       DOM::AbstractViewImpl *impl() const { return m_impl.get(); }
       enum { Document, GetComputedStyle };
     private:
  -    khtml::SharedPtr<DOM::AbstractViewImpl> m_impl;
  +    SharedPtr<DOM::AbstractViewImpl> m_impl;
     };
   
     ValueImp *getDOMAbstractView(ExecState *exec, DOM::AbstractViewImpl *av);
  
  
  
  1.181     +0 -1      WebCore/khtml/ecma/kjs_window.cpp
  
  Index: kjs_window.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/kjs_window.cpp,v
  retrieving revision 1.180
  retrieving revision 1.181
  diff -u -r1.180 -r1.181
  --- kjs_window.cpp	24 Sep 2005 01:18:53 -0000	1.180
  +++ kjs_window.cpp	27 Sep 2005 22:37:05 -0000	1.181
  @@ -90,7 +90,6 @@
   using DOM::NodeImpl;
   using DOM::Position;
   
  -using khtml::SharedPtr;
   using khtml::TypingCommand;
   
   using KParts::ReadOnlyPart;
  
  
  
  1.20      +4 -4      WebCore/khtml/ecma/xmlhttprequest.h
  
  Index: xmlhttprequest.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/ecma/xmlhttprequest.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- xmlhttprequest.h	23 Aug 2005 16:45:12 -0000	1.19
  +++ xmlhttprequest.h	27 Sep 2005 22:37:05 -0000	1.20
  @@ -58,7 +58,7 @@
       virtual bool implementsConstruct() const;
       virtual ObjectImp *construct(ExecState *exec, const List &args);
     private:
  -    khtml::SharedPtr<DOM::DocumentImpl> doc;
  +    SharedPtr<DOM::DocumentImpl> doc;
     };
   
     class XMLHttpRequest : public DOMObject {
  @@ -125,8 +125,8 @@
       KIO::TransferJob * job;
   
       XMLHttpRequestState state;
  -    khtml::SharedPtr<JSUnprotectedEventListener> onReadyStateChangeListener;
  -    khtml::SharedPtr<JSUnprotectedEventListener> onLoadListener;
  +    SharedPtr<JSUnprotectedEventListener> onReadyStateChangeListener;
  +    SharedPtr<JSUnprotectedEventListener> onLoadListener;
   
       khtml::Decoder *decoder;
       QString encoding;
  @@ -136,7 +136,7 @@
       QString response;
       mutable bool createdDocument;
       mutable bool typeIsXML;
  -    mutable khtml::SharedPtr<DOM::DocumentImpl> responseXML;
  +    mutable SharedPtr<DOM::DocumentImpl> responseXML;
   
       bool aborted;
     };
  
  
  
  1.96      +1 -1      WebCore/khtml/editing/SelectionController.cpp
  
  Index: SelectionController.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/SelectionController.cpp,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- SelectionController.cpp	24 Sep 2005 06:29:07 -0000	1.95
  +++ SelectionController.cpp	27 Sep 2005 22:37:08 -0000	1.96
  @@ -45,7 +45,7 @@
   #include "xml/dom2_rangeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/append_node_command.cpp
  
  Index: append_node_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/append_node_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- append_node_command.cpp	12 May 2005 04:00:19 -0000	1.1
  +++ append_node_command.cpp	27 Sep 2005 22:37:09 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "xml/dom_nodeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.15      +1 -1      WebCore/khtml/editing/apply_style_command.cpp
  
  Index: apply_style_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/apply_style_command.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- apply_style_command.cpp	24 Sep 2005 01:18:54 -0000	1.14
  +++ apply_style_command.cpp	27 Sep 2005 22:37:09 -0000	1.15
  @@ -41,7 +41,7 @@
   #include "xml/dom2_rangeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.8       +1 -1      WebCore/khtml/editing/break_blockquote_command.cpp
  
  Index: break_blockquote_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/break_blockquote_command.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- break_blockquote_command.cpp	24 Sep 2005 01:18:55 -0000	1.7
  +++ break_blockquote_command.cpp	27 Sep 2005 22:37:09 -0000	1.8
  @@ -33,7 +33,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.13      +1 -1      WebCore/khtml/editing/composite_edit_command.cpp
  
  Index: composite_edit_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- composite_edit_command.cpp	24 Sep 2005 01:18:55 -0000	1.12
  +++ composite_edit_command.cpp	27 Sep 2005 22:37:09 -0000	1.13
  @@ -52,7 +52,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/delete_from_text_node_command.cpp
  
  Index: delete_from_text_node_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/delete_from_text_node_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- delete_from_text_node_command.cpp	16 Sep 2005 22:42:06 -0000	1.2
  +++ delete_from_text_node_command.cpp	27 Sep 2005 22:37:09 -0000	1.3
  @@ -28,7 +28,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.18      +1 -1      WebCore/khtml/editing/delete_selection_command.cpp
  
  Index: delete_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/delete_selection_command.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- delete_selection_command.cpp	24 Sep 2005 01:18:55 -0000	1.17
  +++ delete_selection_command.cpp	27 Sep 2005 22:37:09 -0000	1.18
  @@ -39,7 +39,7 @@
   
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.8       +1 -1      WebCore/khtml/editing/edit_command.cpp
  
  Index: edit_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/edit_command.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- edit_command.cpp	24 Sep 2005 01:18:55 -0000	1.7
  +++ edit_command.cpp	27 Sep 2005 22:37:09 -0000	1.8
  @@ -34,7 +34,7 @@
   #include "css/css_computedstyle.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.258     +1 -1      WebCore/khtml/editing/htmlediting.cpp
  
  Index: htmlediting.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/htmlediting.cpp,v
  retrieving revision 1.257
  retrieving revision 1.258
  diff -u -r1.257 -r1.258
  --- htmlediting.cpp	25 Aug 2005 23:13:44 -0000	1.257
  +++ htmlediting.cpp	27 Sep 2005 22:37:09 -0000	1.258
  @@ -84,7 +84,7 @@
   using DOM::TreeWalkerImpl;
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #include "KWQKHTMLPart.h"
   #else
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/insert_into_text_node_command.cpp
  
  Index: insert_into_text_node_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_into_text_node_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- insert_into_text_node_command.cpp	16 Sep 2005 22:42:06 -0000	1.2
  +++ insert_into_text_node_command.cpp	27 Sep 2005 22:37:10 -0000	1.3
  @@ -28,7 +28,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.7       +1 -1      WebCore/khtml/editing/insert_line_break_command.cpp
  
  Index: insert_line_break_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_line_break_command.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- insert_line_break_command.cpp	24 Sep 2005 01:18:56 -0000	1.6
  +++ insert_line_break_command.cpp	27 Sep 2005 22:37:10 -0000	1.7
  @@ -37,7 +37,7 @@
   #include "khtml_part.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/insert_node_before_command.cpp
  
  Index: insert_node_before_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_node_before_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- insert_node_before_command.cpp	13 May 2005 08:37:15 -0000	1.1
  +++ insert_node_before_command.cpp	27 Sep 2005 22:37:10 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "xml/dom_nodeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.8       +1 -1      WebCore/khtml/editing/insert_paragraph_separator_command.cpp
  
  Index: insert_paragraph_separator_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_paragraph_separator_command.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- insert_paragraph_separator_command.cpp	24 Sep 2005 01:18:56 -0000	1.7
  +++ insert_paragraph_separator_command.cpp	27 Sep 2005 22:37:10 -0000	1.8
  @@ -37,7 +37,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.9       +1 -1      WebCore/khtml/editing/insert_text_command.cpp
  
  Index: insert_text_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- insert_text_command.cpp	24 Sep 2005 01:18:56 -0000	1.8
  +++ insert_text_command.cpp	27 Sep 2005 22:37:10 -0000	1.9
  @@ -36,7 +36,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/join_text_nodes_command.cpp
  
  Index: join_text_nodes_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/join_text_nodes_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- join_text_nodes_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ join_text_nodes_command.cpp	27 Sep 2005 22:37:10 -0000	1.2
  @@ -29,7 +29,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.35      +1 -1      WebCore/khtml/editing/markup.cpp
  
  Index: markup.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- markup.cpp	16 Sep 2005 22:42:07 -0000	1.34
  +++ markup.cpp	27 Sep 2005 22:37:10 -0000	1.35
  @@ -57,7 +57,7 @@
   using DOM::TextImpl;
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) ((void)0)
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/merge_identical_elements_command.cpp
  
  Index: merge_identical_elements_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/merge_identical_elements_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- merge_identical_elements_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ merge_identical_elements_command.cpp	27 Sep 2005 22:37:10 -0000	1.2
  @@ -29,7 +29,7 @@
   #include "xml/dom_elementimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.4       +1 -1      WebCore/khtml/editing/move_selection_command.cpp
  
  Index: move_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/move_selection_command.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- move_selection_command.cpp	24 Sep 2005 01:18:57 -0000	1.3
  +++ move_selection_command.cpp	27 Sep 2005 22:37:10 -0000	1.4
  @@ -29,7 +29,7 @@
   #include "xml/dom_docimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/rebalance_whitespace_command.cpp
  
  Index: rebalance_whitespace_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/rebalance_whitespace_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- rebalance_whitespace_command.cpp	16 Sep 2005 22:42:07 -0000	1.2
  +++ rebalance_whitespace_command.cpp	27 Sep 2005 22:37:11 -0000	1.3
  @@ -31,7 +31,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/remove_css_property_command.cpp
  
  Index: remove_css_property_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/remove_css_property_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- remove_css_property_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ remove_css_property_command.cpp	27 Sep 2005 22:37:11 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "css/css_valueimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.4       +1 -1      WebCore/khtml/editing/remove_node_attribute_command.cpp
  
  Index: remove_node_attribute_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/remove_node_attribute_command.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- remove_node_attribute_command.cpp	29 Aug 2005 21:29:15 -0000	1.3
  +++ remove_node_attribute_command.cpp	27 Sep 2005 22:37:11 -0000	1.4
  @@ -28,7 +28,7 @@
   #include "xml/dom_elementimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/remove_node_command.cpp
  
  Index: remove_node_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/remove_node_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- remove_node_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ remove_node_command.cpp	27 Sep 2005 22:37:11 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "xml/dom_nodeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/remove_node_preserving_children_command.cpp
  
  Index: remove_node_preserving_children_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/remove_node_preserving_children_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- remove_node_preserving_children_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ remove_node_preserving_children_command.cpp	27 Sep 2005 22:37:11 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "xml/dom_nodeimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.16      +1 -1      WebCore/khtml/editing/replace_selection_command.cpp
  
  Index: replace_selection_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/replace_selection_command.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- replace_selection_command.cpp	24 Sep 2005 01:18:57 -0000	1.15
  +++ replace_selection_command.cpp	27 Sep 2005 22:37:11 -0000	1.16
  @@ -42,7 +42,7 @@
   #include "css/cssproperties.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.4       +1 -1      WebCore/khtml/editing/set_node_attribute_command.cpp
  
  Index: set_node_attribute_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/set_node_attribute_command.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- set_node_attribute_command.cpp	29 Aug 2005 21:29:15 -0000	1.3
  +++ set_node_attribute_command.cpp	27 Sep 2005 22:37:11 -0000	1.4
  @@ -28,7 +28,7 @@
   #include "xml/dom_elementimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/split_element_command.cpp
  
  Index: split_element_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/split_element_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- split_element_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ split_element_command.cpp	27 Sep 2005 22:37:11 -0000	1.2
  @@ -28,7 +28,7 @@
   #include "xml/dom_elementimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.4       +1 -1      WebCore/khtml/editing/split_text_node_command.cpp
  
  Index: split_text_node_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/split_text_node_command.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- split_text_node_command.cpp	16 Sep 2005 22:42:07 -0000	1.3
  +++ split_text_node_command.cpp	27 Sep 2005 22:37:11 -0000	1.4
  @@ -29,7 +29,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/split_text_node_containing_element.cpp
  
  Index: split_text_node_containing_element.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/split_text_node_containing_element.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- split_text_node_containing_element.cpp	16 Sep 2005 22:42:07 -0000	1.2
  +++ split_text_node_containing_element.cpp	27 Sep 2005 22:37:11 -0000	1.3
  @@ -30,7 +30,7 @@
   #include "rendering/render_object.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.3       +1 -1      WebCore/khtml/editing/typing_command.cpp
  
  Index: typing_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/typing_command.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- typing_command.cpp	24 Sep 2005 01:18:58 -0000	1.2
  +++ typing_command.cpp	27 Sep 2005 22:37:11 -0000	1.3
  @@ -36,7 +36,7 @@
   #include "visible_units.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.59      +1 -1      WebCore/khtml/editing/visible_position.cpp
  
  Index: visible_position.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_position.cpp,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- visible_position.cpp	16 Sep 2005 22:42:07 -0000	1.58
  +++ visible_position.cpp	27 Sep 2005 22:37:11 -0000	1.59
  @@ -35,7 +35,7 @@
   #include "xml/dom_textimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.32      +1 -1      WebCore/khtml/editing/visible_position.h
  
  Index: visible_position.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/visible_position.h,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- visible_position.h	16 Sep 2005 22:42:07 -0000	1.31
  +++ visible_position.h	27 Sep 2005 22:37:12 -0000	1.32
  @@ -128,7 +128,7 @@
       return !(a == b);
   }
   
  -khtml::SharedPtr<DOM::RangeImpl> makeRange(const VisiblePosition &start, const VisiblePosition &end);
  +SharedPtr<DOM::RangeImpl> makeRange(const VisiblePosition &start, const VisiblePosition &end);
   bool setStart(DOM::RangeImpl *, const VisiblePosition &start);
   bool setEnd(DOM::RangeImpl *, const VisiblePosition &start);
   VisiblePosition startVisiblePosition(const DOM::RangeImpl *, EAffinity);
  
  
  
  1.2       +1 -1      WebCore/khtml/editing/wrap_contents_in_dummy_span_command.cpp
  
  Index: wrap_contents_in_dummy_span_command.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/editing/wrap_contents_in_dummy_span_command.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- wrap_contents_in_dummy_span_command.cpp	24 May 2005 07:21:47 -0000	1.1
  +++ wrap_contents_in_dummy_span_command.cpp	27 Sep 2005 22:37:12 -0000	1.2
  @@ -29,7 +29,7 @@
   #include "xml/dom_elementimpl.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #else
   #define ASSERT(assertion) assert(assertion)
   #endif
  
  
  
  1.26      +1 -1      WebCore/khtml/html/html_imageimpl.h
  
  Index: html_imageimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_imageimpl.h,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- html_imageimpl.h	16 Sep 2005 22:42:11 -0000	1.25
  +++ html_imageimpl.h	27 Sep 2005 22:37:17 -0000	1.26
  @@ -228,7 +228,7 @@
       bool mapMouseEvent(int x_, int y_, int width_, int height_,
                          khtml::RenderObject::NodeInfo& info);
   
  -    khtml::SharedPtr<HTMLCollectionImpl> areas();
  +    SharedPtr<HTMLCollectionImpl> areas();
   
       DOMString name() const;
       void setName( const DOMString & );
  
  
  
  1.28      +4 -4      WebCore/khtml/html/html_tableimpl.h
  
  Index: html_tableimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_tableimpl.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- html_tableimpl.h	16 Sep 2005 22:42:12 -0000	1.27
  +++ html_tableimpl.h	27 Sep 2005 22:37:17 -0000	1.28
  @@ -86,8 +86,8 @@
       HTMLElementImpl *insertRow ( int index, int &exceptioncode );
       void deleteRow ( int index, int &exceptioncode );
   
  -    khtml::SharedPtr<HTMLCollectionImpl> rows();
  -    khtml::SharedPtr<HTMLCollectionImpl> tBodies();
  +    SharedPtr<HTMLCollectionImpl> rows();
  +    SharedPtr<HTMLCollectionImpl> tBodies();
   
       DOMString align() const;
       void setAlign( const DOMString & );
  @@ -188,7 +188,7 @@
       DOMString vAlign() const;
       void setVAlign( const DOMString & );
   
  -    khtml::SharedPtr<HTMLCollectionImpl> rows();
  +    SharedPtr<HTMLCollectionImpl> rows();
   };
   
   // -------------------------------------------------------------------------
  @@ -215,7 +215,7 @@
   
       void setSectionRowIndex( int  );
   
  -    khtml::SharedPtr<HTMLCollectionImpl> cells();
  +    SharedPtr<HTMLCollectionImpl> cells();
       void setCells(HTMLCollectionImpl *, int &exception);
   
       DOMString align() const;
  
  
  
  1.113     +2 -4      WebCore/khtml/html/htmlparser.cpp
  
  Index: htmlparser.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/htmlparser.cpp,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- htmlparser.cpp	16 Sep 2005 22:42:12 -0000	1.112
  +++ htmlparser.cpp	27 Sep 2005 22:37:18 -0000	1.113
  @@ -47,7 +47,7 @@
   #include "htmlfactory.h"
   #include "xml/dom_textimpl.h"
   #include "xml/dom_nodeimpl.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "misc/hashset.h"
   #include "html/htmltokenizer.h"
   #include "khtmlview.h"
  @@ -71,7 +71,7 @@
   /**
    * @internal
    */
  -class HTMLStackElem
  +class HTMLStackElem : public FastAllocated
   {
   public:
       HTMLStackElem(const AtomicString& _tagName,
  @@ -87,8 +87,6 @@
           next(_next)
           { }
   
  -    MAIN_THREAD_ALLOCATED;
  -
       AtomicString tagName;
       int level;
       bool strayTableContent;
  
  
  
  1.6       +4 -6      WebCore/khtml/misc/arena.cpp
  
  Index: arena.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/arena.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- arena.cpp	1 Aug 2005 04:31:57 -0000	1.5
  +++ arena.cpp	27 Sep 2005 22:37:18 -0000	1.6
  @@ -47,11 +47,9 @@
   #include <algorithm>
   #include <stdlib.h>
   #include <string.h>
  -#include "main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   using std::max;
  -using khtml::main_thread_malloc;
  -using khtml::main_thread_free;
   
   //#define DEBUG_ARENA_MALLOC
   #ifdef DEBUG_ARENA_MALLOC
  @@ -176,7 +174,7 @@
           i++;
           printf("Malloc: %d\n", i);
   #endif
  -        a = (Arena*)main_thread_malloc(sz);
  +        a = (Arena*)fastMalloc(sz);
           if (a)  {
               a->limit = (uword)a + sz;
               a->base = a->avail = (uword)ARENA_ALIGN(pool, a + 1);
  @@ -242,7 +240,7 @@
                   printf("Free: %d\n", i);
               }
   #endif
  -            main_thread_free(a); a = 0;
  +            fastFree(a); a = 0;
           } while ((a = *ap) != 0);
       } else {
           /* Insert the whole arena chain at the front of the freelist. */
  @@ -286,7 +284,7 @@
   
       for (a = arena_freelist; a; a = next) {
           next = a->next;
  -        main_thread_free(a); a = 0;
  +        fastFree(a); a = 0;
       }
       arena_freelist = NULL;
   }
  
  
  
  1.12      +7 -7      WebCore/khtml/misc/hashtable.h
  
  Index: hashtable.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/hashtable.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- hashtable.h	30 Jul 2005 02:33:21 -0000	1.11
  +++ hashtable.h	27 Sep 2005 22:37:18 -0000	1.12
  @@ -23,7 +23,7 @@
   #ifndef HASHTABLE_H
   #define HASHTABLE_H
   
  -#include "main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include <utility>
   
   namespace khtml {
  @@ -179,7 +179,7 @@
       typedef Value ValueType;
   
       HashTable() : m_table(0), m_tableSize(0), m_tableSizeMask(0), m_keyCount(0), m_deletedCount(0) {}
  -    ~HashTable() { main_thread_free(m_table); }
  +    ~HashTable() { fastFree(m_table); }
   
       HashTable(const HashTable& other);
       void swap(const HashTable& other);
  @@ -430,9 +430,9 @@
       // would use a template member function with explicit specializations here, but
       // gcc doesn't appear to support that
       if (Traits::emptyValueIsZero)
  -        return reinterpret_cast<ValueType *>(main_thread_calloc(size, sizeof(ValueType))); 
  +        return reinterpret_cast<ValueType *>(fastCalloc(size, sizeof(ValueType))); 
       else {
  -        ValueType *result = reinterpret_cast<ValueType *>(main_thread_malloc(size * sizeof(ValueType))); 
  +        ValueType *result = reinterpret_cast<ValueType *>(fastMalloc(size * sizeof(ValueType))); 
           for (int i = 0; i < size; i++) {
               clearBucket(result[i]);
           }
  @@ -479,7 +479,7 @@
   
       m_deletedCount = 0;
       
  -    main_thread_free(oldTable);
  +    fastFree(oldTable);
   
       checkTableConsistency();
   }
  @@ -487,7 +487,7 @@
   template<typename Key, typename Value, Key ExtractKey(const Value &), typename HashFunctions, typename Traits>
   inline void HashTable<Key, Value, ExtractKey, HashFunctions, Traits>::clear()
   {
  -    main_thread_free(m_table);
  +    fastFree(m_table);
       m_table = 0;
       m_tableSize = 0;
       m_tableSizeMask = 0;
  @@ -503,7 +503,7 @@
       , m_deletedCount(other.m_deletedCount)
   {
       if (m_tableSize != 0) {
  -        m_table = main_thread_malloc(m_tableSize);
  +        m_table = fastMalloc(m_tableSize);
           memcpy(other.m_table, m_table, m_tableSize * sizeof(ValueType));
       }
   }
  
  
  
  1.76      +1 -1      WebCore/khtml/misc/loader.cpp
  
  Index: loader.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/loader.cpp,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- loader.cpp	21 Sep 2005 21:05:53 -0000	1.75
  +++ loader.cpp	27 Sep 2005 22:37:19 -0000	1.76
  @@ -62,7 +62,7 @@
   #endif
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLoader.h"
   #endif
   
  
  
  
  1.8       +1 -5      WebCore/khtml/misc/shared.h
  
  Index: shared.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/misc/shared.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- shared.h	30 Aug 2005 23:56:15 -0000	1.7
  +++ shared.h	27 Sep 2005 22:37:19 -0000	1.8
  @@ -1,7 +1,7 @@
   #ifndef SHARED_H
   #define SHARED_H
   
  -#include <kjs/shared_ptr.h>
  +#include <kxmlcore/SharedPtr.h>
   
   namespace khtml {
   
  @@ -62,10 +62,6 @@
       TreeShared &operator=(const TreeShared &);
   };
   
  -using KXMLCore::SharedPtr;
  -using KXMLCore::static_pointer_cast;
  -using KXMLCore::const_pointer_cast;
  -
   }
   
   #endif
  
  
  
  1.90      +11 -33    WebCore/khtml/rendering/render_style.h
  
  Index: render_style.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_style.h,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- render_style.h	30 Aug 2005 21:36:24 -0000	1.89
  +++ render_style.h	27 Sep 2005 22:37:20 -0000	1.90
  @@ -41,7 +41,7 @@
   #include <qpalette.h>
   #include <qapplication.h>
   
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "misc/khtmllayout.h"
   #include "misc/shared.h"
   #include "rendering/font.h"
  @@ -363,14 +363,12 @@
   
   enum EMarginCollapse { MCOLLAPSE, MSEPARATE, MDISCARD };
   
  -class StyleSurroundData : public Shared<StyleSurroundData>
  +class StyleSurroundData : public Shared<StyleSurroundData>, public FastAllocated
   {
   public:
       StyleSurroundData();
       StyleSurroundData(const StyleSurroundData& o);
       
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const StyleSurroundData& o) const;
       bool operator!=(const StyleSurroundData& o) const {
           return !(*this == o);
  @@ -386,14 +384,12 @@
   //------------------------------------------------
   // Box attributes. Not inherited.
   
  -class StyleBoxData : public Shared<StyleBoxData>
  +class StyleBoxData : public Shared<StyleBoxData>, public FastAllocated
   {
   public:
       StyleBoxData();
       StyleBoxData(const StyleBoxData& o);
   
  -    MAIN_THREAD_ALLOCATED;
  -
       // copy and assignment
   //    StyleBoxData(const StyleBoxData &other);
   //    const StyleBoxData &operator = (const StyleBoxData &other);
  @@ -465,15 +461,13 @@
       UBNormal, Embed, Override
   };
   
  -class StyleVisualData : public Shared<StyleVisualData>
  +class StyleVisualData : public Shared<StyleVisualData>, public FastAllocated
   {
   public:
       StyleVisualData();
       ~StyleVisualData();
       StyleVisualData(const StyleVisualData& o );
   
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==( const StyleVisualData &o ) const {
   	return ( clip == o.clip &&
                    hasClip == o.hasClip &&
  @@ -512,13 +506,11 @@
       REPEAT, REPEAT_X, REPEAT_Y, NO_REPEAT
   };
   
  -struct BackgroundLayer {
  +struct BackgroundLayer : public FastAllocated {
   public:
       BackgroundLayer();
       ~BackgroundLayer();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       CachedImage* backgroundImage() const { return m_image; }
       Length backgroundXPosition() const { return m_xPosition; }
       Length backgroundYPosition() const { return m_yPosition; }
  @@ -601,15 +593,13 @@
       BackgroundLayer* m_next;
   };
   
  -class StyleBackgroundData : public Shared<StyleBackgroundData>
  +class StyleBackgroundData : public Shared<StyleBackgroundData>, public FastAllocated
   {
   public:
       StyleBackgroundData();
       ~StyleBackgroundData() {}
       StyleBackgroundData(const StyleBackgroundData& o );
   
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const StyleBackgroundData& o) const;
       bool operator!=(const StyleBackgroundData &o) const {
   	return !(*this == o);
  @@ -626,14 +616,12 @@
   enum EMarqueeBehavior { MNONE, MSCROLL, MSLIDE, MALTERNATE, MUNFURL };
   enum EMarqueeDirection { MAUTO = 0, MLEFT = 1, MRIGHT = -1, MUP = 2, MDOWN = -2, MFORWARD = 3, MBACKWARD = -3 };
   
  -class StyleMarqueeData : public Shared<StyleMarqueeData>
  +class StyleMarqueeData : public Shared<StyleMarqueeData>, public FastAllocated
   {
   public:
       StyleMarqueeData();
       StyleMarqueeData(const StyleMarqueeData& o);
       
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const StyleMarqueeData& o) const;
       bool operator!=(const StyleMarqueeData& o) const {
           return !(*this == o);
  @@ -656,14 +644,12 @@
   enum EBoxLines { SINGLE, MULTIPLE };
   enum EBoxDirection { BNORMAL, BREVERSE };
   
  -class StyleFlexibleBoxData : public Shared<StyleFlexibleBoxData>
  +class StyleFlexibleBoxData : public Shared<StyleFlexibleBoxData>, public FastAllocated
   {
   public:
       StyleFlexibleBoxData();
       StyleFlexibleBoxData(const StyleFlexibleBoxData& o);
   
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const StyleFlexibleBoxData& o) const;
       bool operator!=(const StyleFlexibleBoxData &o) const {
           return !(*this == o);
  @@ -680,15 +666,13 @@
   };
   
   // This struct holds information about shadows for the text-shadow and box-shadow properties.
  -struct ShadowData {
  +struct ShadowData : public FastAllocated {
       ShadowData(int _x, int _y, int _blur, const QColor& _color)
       :x(_x), y(_y), blur(_blur), color(_color), next(0) {}
       ShadowData(const ShadowData& o);
       
       ~ShadowData() { delete next; }
   
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const ShadowData& o) const;
       bool operator!=(const ShadowData &o) const {
           return !(*this == o);
  @@ -777,15 +761,13 @@
   // This struct is for rarely used non-inherited CSS3 properties.  By grouping them together,
   // we save space, and only allocate this object when someone actually uses
   // a non-inherited CSS3 property.
  -class StyleCSS3NonInheritedData : public Shared<StyleCSS3NonInheritedData>
  +class StyleCSS3NonInheritedData : public Shared<StyleCSS3NonInheritedData>, public FastAllocated
   {
   public:
       StyleCSS3NonInheritedData();
       ~StyleCSS3NonInheritedData();
       StyleCSS3NonInheritedData(const StyleCSS3NonInheritedData& o);
   
  -    MAIN_THREAD_ALLOCATED;
  -
   #ifndef KHTML_NO_XBL
       bool bindingsEquivalent(const StyleCSS3NonInheritedData& o) const;
   #endif
  @@ -819,15 +801,13 @@
   // This struct is for rarely used inherited CSS3 properties.  By grouping them together,
   // we save space, and only allocate this object when someone actually uses
   // an inherited CSS3 property.
  -class StyleCSS3InheritedData : public Shared<StyleCSS3InheritedData>
  +class StyleCSS3InheritedData : public Shared<StyleCSS3InheritedData>, public FastAllocated
   {
   public:
       StyleCSS3InheritedData();
       ~StyleCSS3InheritedData();
       StyleCSS3InheritedData(const StyleCSS3InheritedData& o);
   
  -    MAIN_THREAD_ALLOCATED;
  -
       bool operator==(const StyleCSS3InheritedData& o) const;
       bool operator!=(const StyleCSS3InheritedData &o) const {
           return !(*this == o);
  @@ -882,8 +862,6 @@
       ~StyleInheritedData();
       StyleInheritedData(const StyleInheritedData& o );
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       bool operator==(const StyleInheritedData& o) const;
       bool operator != ( const StyleInheritedData &o ) const {
   	return !(*this == o);
  
  
  
  1.31      +3 -9      WebCore/khtml/xml/dom2_eventsimpl.h
  
  Index: dom2_eventsimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_eventsimpl.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- dom2_eventsimpl.h	16 Sep 2005 22:42:19 -0000	1.30
  +++ dom2_eventsimpl.h	27 Sep 2005 22:37:21 -0000	1.31
  @@ -44,15 +44,13 @@
   class NodeImpl;
   class ClipboardImpl;
   
  -class EventImpl : public khtml::Shared<EventImpl>
  +class EventImpl : public khtml::Shared<EventImpl>, public FastAllocated
   {
   public:
       EventImpl();
       EventImpl(const AtomicString &type, bool canBubbleArg, bool cancelableArg);
       virtual ~EventImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       const AtomicString &type() const { return m_type; }
       NodeImpl *target() const { return m_target; }
       void setTarget(NodeImpl *target);
  @@ -361,13 +359,11 @@
       int m_wheelDelta;
   };
   
  -class RegisteredEventListener {
  +class RegisteredEventListener : public FastAllocated {
   public:
       RegisteredEventListener(const AtomicString &eventType, EventListener *listener, bool useCapture);
       ~RegisteredEventListener();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       const AtomicString &eventType() const { return m_eventType; }
       EventListener *listener() const { return m_listener; }
       bool useCapture() const { return m_useCapture; }
  @@ -385,13 +381,11 @@
   inline bool operator!=(const RegisteredEventListener &a, const RegisteredEventListener &b) { return !(a == b); }
   
   // State available during IE's events for drag and drop and copy/paste
  -class ClipboardImpl : public khtml::Shared<ClipboardImpl> {
  +class ClipboardImpl : public khtml::Shared<ClipboardImpl>, public FastAllocated {
   public:
       ClipboardImpl() { }
       virtual ~ClipboardImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       // Is this operation a drag-drop or a copy-paste?
       virtual bool isForDragging() const = 0;
   
  
  
  
  1.28      +3 -5      WebCore/khtml/xml/dom2_rangeimpl.h
  
  Index: dom2_rangeimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_rangeimpl.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- dom2_rangeimpl.h	16 Sep 2005 22:42:19 -0000	1.27
  +++ dom2_rangeimpl.h	27 Sep 2005 22:37:21 -0000	1.28
  @@ -29,7 +29,7 @@
   
   #include "dom/dom2_range.h"
   #include "misc/shared.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   namespace DOM {
   
  @@ -39,7 +39,7 @@
   class NodeImpl;
   class Position;
   
  -class RangeImpl : public khtml::Shared<RangeImpl>
  +class RangeImpl : public khtml::Shared<RangeImpl>, public FastAllocated
   {
       friend class DocumentImpl;
   public:
  @@ -50,8 +50,6 @@
   
       ~RangeImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       NodeImpl *startContainer(int &exceptioncode) const;
       int startOffset(int &exceptioncode) const;
       NodeImpl *endContainer(int &exceptioncode) const;
  @@ -125,7 +123,7 @@
       bool containedByReadOnly() const;
   };
   
  -khtml::SharedPtr<RangeImpl> rangeOfContents(NodeImpl *node);
  +SharedPtr<RangeImpl> rangeOfContents(NodeImpl *node);
   
   bool operator==(const RangeImpl &, const RangeImpl &);
   inline bool operator!=(const RangeImpl &a, const RangeImpl &b) { return !(a == b); }
  
  
  
  1.12      +3 -7      WebCore/khtml/xml/dom2_traversalimpl.h
  
  Index: dom2_traversalimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_traversalimpl.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- dom2_traversalimpl.h	16 Sep 2005 22:42:19 -0000	1.11
  +++ dom2_traversalimpl.h	27 Sep 2005 22:37:21 -0000	1.12
  @@ -28,21 +28,19 @@
   
   #include "dom/dom2_traversal.h"
   #include "misc/shared.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   namespace DOM {
   
   class NodeImpl;
   class DocumentImpl;
   
  -class NodeFilterImpl : public khtml::Shared<NodeFilterImpl>
  +class NodeFilterImpl : public khtml::Shared<NodeFilterImpl>, public FastAllocated
   {
   public:
       NodeFilterImpl(NodeFilterCondition *);
       ~NodeFilterImpl();
       
  -    MAIN_THREAD_ALLOCATED;
  -    
       short acceptNode(NodeImpl *) const;
       
   private:
  @@ -52,14 +50,12 @@
       NodeFilterCondition *m_condition;
   };
   
  -class TraversalImpl : public khtml::Shared<TraversalImpl>
  +class TraversalImpl : public khtml::Shared<TraversalImpl>, public FastAllocated
   {
   public:
       TraversalImpl(NodeImpl *, int whatToShow, NodeFilterImpl *, bool expandEntityReferences);
       ~TraversalImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       NodeImpl *root() const { return m_root; }
       unsigned whatToShow() const { return m_whatToShow; }
       NodeFilterImpl *filter() const { return m_filter; }
  
  
  
  1.7       +2 -4      WebCore/khtml/xml/dom2_viewsimpl.h
  
  Index: dom2_viewsimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom2_viewsimpl.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- dom2_viewsimpl.h	12 May 2005 17:11:22 -0000	1.6
  +++ dom2_viewsimpl.h	27 Sep 2005 22:37:21 -0000	1.7
  @@ -25,7 +25,7 @@
   
   #include "css/css_valueimpl.h"
   #include "misc/shared.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
   namespace DOM {
   
  @@ -35,14 +35,12 @@
   class DOMStringImpl;
   
   // Introduced in DOM Level 2:
  -class AbstractViewImpl : public khtml::Shared<AbstractViewImpl>
  +class AbstractViewImpl : public khtml::Shared<AbstractViewImpl>, public FastAllocated
   {
   public:
       AbstractViewImpl(DocumentImpl *_document);
       ~AbstractViewImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -    
       DocumentImpl *document() const { return m_document; }
       CSSStyleDeclarationImpl *getComputedStyle(ElementImpl *elt, DOMStringImpl *pseudoElt);
   protected:
  
  
  
  1.128     +1 -3      WebCore/khtml/xml/dom_docimpl.h
  
  Index: dom_docimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.h,v
  retrieving revision 1.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- dom_docimpl.h	23 Sep 2005 03:28:28 -0000	1.127
  +++ dom_docimpl.h	27 Sep 2005 22:37:21 -0000	1.128
  @@ -125,14 +125,12 @@
           }
       };
       
  -class DOMImplementationImpl : public khtml::Shared<DOMImplementationImpl>
  +class DOMImplementationImpl : public khtml::Shared<DOMImplementationImpl>, public FastAllocated
   {
   public:
       DOMImplementationImpl();
       ~DOMImplementationImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       // DOM methods & attributes for DOMImplementation
       bool hasFeature ( const DOMString &feature, const DOMString &version );
       DocumentTypeImpl *createDocumentType( const DOMString &qualifiedName, const DOMString &publicId,
  
  
  
  1.83      +7 -7      WebCore/khtml/xml/dom_elementimpl.cpp
  
  Index: dom_elementimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.cpp,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- dom_elementimpl.cpp	16 Sep 2005 22:42:20 -0000	1.82
  +++ dom_elementimpl.cpp	27 Sep 2005 22:37:21 -0000	1.83
  @@ -965,7 +965,7 @@
                   attrs[i]->m_impl->m_element = 0;
               attrs[i]->deref();
           }
  -        main_thread_free(attrs);
  +        fastFree(attrs);
           attrs = 0;
       }
       len = 0;
  @@ -996,7 +996,7 @@
   
       clearAttributes();
       len = other.len;
  -    attrs = static_cast<AttributeImpl **>(main_thread_malloc(len * sizeof(AttributeImpl *)));
  +    attrs = static_cast<AttributeImpl **>(fastMalloc(len * sizeof(AttributeImpl *)));
   
       // first initialize attrs vector, then call attributeChanged on it
       // this allows attributeChanged to use getAttribute
  @@ -1018,11 +1018,11 @@
   void NamedAttrMapImpl::addAttribute(AttributeImpl *attr)
   {
       // Add the attribute to the list
  -    AttributeImpl **newAttrs = static_cast<AttributeImpl **>(main_thread_malloc((len + 1) * sizeof(AttributeImpl *)));
  +    AttributeImpl **newAttrs = static_cast<AttributeImpl **>(fastMalloc((len + 1) * sizeof(AttributeImpl *)));
       if (attrs) {
         for (uint i = 0; i < len; i++)
           newAttrs[i] = attrs[i];
  -      main_thread_free(attrs);
  +      fastFree(attrs);
       }
       attrs = newAttrs;
       attrs[len++] = attr;
  @@ -1057,19 +1057,19 @@
       if (attrs[index]->m_impl)
           attrs[index]->m_impl->m_element = 0;
       if (len == 1) {
  -        main_thread_free(attrs);
  +        fastFree(attrs);
           attrs = 0;
           len = 0;
       }
       else {
  -        AttributeImpl **newAttrs = static_cast<AttributeImpl **>(main_thread_malloc((len - 1) * sizeof(AttributeImpl *)));
  +        AttributeImpl **newAttrs = static_cast<AttributeImpl **>(fastMalloc((len - 1) * sizeof(AttributeImpl *)));
           uint i;
           for (i = 0; i < uint(index); i++)
               newAttrs[i] = attrs[i];
           len--;
           for (; i < len; i++)
               newAttrs[i] = attrs[i+1];
  -        main_thread_free(attrs);
  +        fastFree(attrs);
           attrs = newAttrs;
       }
   
  
  
  
  1.53      +1 -3      WebCore/khtml/xml/dom_elementimpl.h
  
  Index: dom_elementimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_elementimpl.h,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- dom_elementimpl.h	16 Sep 2005 22:42:20 -0000	1.52
  +++ dom_elementimpl.h	27 Sep 2005 22:37:22 -0000	1.53
  @@ -58,7 +58,7 @@
   // the actual Attr (AttrImpl) with its value as textchild
   // is only allocated on demand by the DOM bindings.
   // Any use of AttrImpl inside khtml should be avoided.
  -class AttributeImpl : public khtml::Shared<AttributeImpl>
  + class AttributeImpl : public khtml::Shared<AttributeImpl>, public FastAllocated
   {
       friend class NamedAttrMapImpl;
       friend class ElementImpl;
  @@ -76,8 +76,6 @@
   
       virtual ~AttributeImpl() {}
       
  -    MAIN_THREAD_ALLOCATED;
  -
       const AtomicString& value() const { return m_value; }
       const AtomicString& prefix() const { return m_name.prefix(); }
       const AtomicString& localName() const { return m_name.localName(); }
  
  
  
  1.194     +1 -1      WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- dom_nodeimpl.cpp	24 Sep 2005 01:19:02 -0000	1.193
  +++ dom_nodeimpl.cpp	27 Sep 2005 22:37:22 -0000	1.194
  @@ -58,7 +58,7 @@
   #endif
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.103     +4 -12     WebCore/khtml/xml/dom_nodeimpl.h
  
  Index: dom_nodeimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.h,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- dom_nodeimpl.h	20 Sep 2005 23:01:41 -0000	1.102
  +++ dom_nodeimpl.h	27 Sep 2005 22:37:22 -0000	1.103
  @@ -27,7 +27,7 @@
   
   #include "dom/dom_string.h"
   #include "dom/dom_node.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   #include "misc/helper.h"
   #include "misc/shared.h"
   #include "dom_atomicstring.h"
  @@ -51,8 +51,6 @@
   
   namespace DOM {
   
  -using khtml::SharedPtr;
  -
   class AtomicString;
   class DocumentImpl;
   class ElementImpl;
  @@ -78,15 +76,13 @@
   };
   
   // this class implements nodes, which can have a parent but no children:
  -class NodeImpl : public khtml::TreeShared<NodeImpl>
  +class NodeImpl : public khtml::TreeShared<NodeImpl>, public FastAllocated
   {
       friend class DocumentImpl;
   public:
       NodeImpl(DocumentPtr *doc);
       virtual ~NodeImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       // DOM methods & attributes for Node
       virtual bool hasTagName(const QualifiedName& tagName) const { return false; }
       virtual DOMString nodeName() const = 0;
  @@ -569,14 +565,12 @@
   class Node;
   class NodeImpl;
   
  -class NodeListImpl : public khtml::Shared<NodeListImpl>
  +class NodeListImpl : public khtml::Shared<NodeListImpl>, public FastAllocated
   {
   public:
       NodeListImpl( NodeImpl *_rootNode );
       virtual ~NodeListImpl();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       // DOM methods & attributes for NodeList
       virtual unsigned length() const = 0;
       virtual NodeImpl *item ( unsigned index ) const = 0;
  @@ -642,14 +636,12 @@
   // Generic NamedNodeMap interface
   // Other classes implement this for more specific situations e.g. attributes
   // of an element
  -class NamedNodeMapImpl : public khtml::Shared<NamedNodeMapImpl>
  +class NamedNodeMapImpl : public khtml::Shared<NamedNodeMapImpl>, public FastAllocated
   {
   public:
       NamedNodeMapImpl() {}
       virtual ~NamedNodeMapImpl() {}
   
  -    MAIN_THREAD_ALLOCATED;
  -
       NodeImpl *getNamedItem(const DOMString &name) const { return getNamedItemNS(DOMString(), name); }
       SharedPtr<NodeImpl> removeNamedItem(const DOMString &name, int &exception) { return removeNamedItemNS(DOMString(), name, exception); }
   
  
  
  
  1.79      +1 -1      WebCore/khtml/xml/dom_position.cpp
  
  Index: dom_position.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_position.cpp,v
  retrieving revision 1.78
  retrieving revision 1.79
  diff -u -r1.78 -r1.79
  --- dom_position.cpp	16 Sep 2005 22:42:20 -0000	1.78
  +++ dom_position.cpp	27 Sep 2005 22:37:22 -0000	1.79
  @@ -47,7 +47,7 @@
   #include "htmlnames.h"
   
   #if APPLE_CHANGES
  -#include "KWQAssertions.h"
  +#include <kxmlcore/Assertions.h>
   #include "KWQLogging.h"
   #else
   #define ASSERT(assertion) assert(assertion)
  
  
  
  1.15      +4 -6      WebCore/khtml/xml/dom_stringimpl.h
  
  Index: dom_stringimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_stringimpl.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- dom_stringimpl.h	21 Jun 2005 22:27:55 -0000	1.14
  +++ dom_stringimpl.h	27 Sep 2005 22:37:23 -0000	1.15
  @@ -26,14 +26,14 @@
   
   #include "misc/khtmllayout.h"
   #include "misc/shared.h"
  -#include "misc/main_thread_malloc.h"
  +#include <kxmlcore/FastMalloc.h>
   
  -#define QT_ALLOC_QCHAR_VEC( N ) static_cast<QChar*>(main_thread_malloc( sizeof(QChar)*( N ) ))
  -#define QT_DELETE_QCHAR_VEC( P ) main_thread_free ((void*)( P ))
  +#define QT_ALLOC_QCHAR_VEC(N) static_cast<QChar*>(fastMalloc(sizeof(QChar)*(N)))
  +#define QT_DELETE_QCHAR_VEC(P) fastFree(P)
   
   namespace DOM {
   
  -class DOMStringImpl : public khtml::Shared<DOMStringImpl>
  +class DOMStringImpl : public khtml::Shared<DOMStringImpl>, public FastAllocated
   {
   private:
       struct WithOneRef { };
  @@ -48,8 +48,6 @@
       DOMStringImpl(const QChar &ch);
       ~DOMStringImpl();
       
  -    MAIN_THREAD_ALLOCATED;
  -
       unsigned hash() const { if (_hash == 0) _hash = computeHash(s, l); return _hash; }
       static unsigned computeHash(const QChar *, int length);
       static unsigned computeHash(const char *);
  
  
  
  1.28      +1 -1      WebCore/kwq/DOM-CSS.mm
  
  Index: DOM-CSS.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOM-CSS.mm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DOM-CSS.mm	23 Sep 2005 18:24:58 -0000	1.27
  +++ DOM-CSS.mm	27 Sep 2005 22:37:25 -0000	1.28
  @@ -41,7 +41,7 @@
   #import "html_headimpl.h"
   
   #import "DOMInternal.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   
   using DOM::AbstractViewImpl;
  
  
  
  1.48      +1 -2      WebCore/kwq/DOM.mm
  
  Index: DOM.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOM.mm,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- DOM.mm	20 Sep 2005 07:55:54 -0000	1.47
  +++ DOM.mm	27 Sep 2005 22:37:25 -0000	1.48
  @@ -55,7 +55,7 @@
   #import "DOMHTML.h"
   #import "DOMInternal.h"
   #import "DOMPrivate.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQKHTMLPart.h"
   
  @@ -96,7 +96,6 @@
   using khtml::HashMap;
   using khtml::PointerHash;
   using khtml::RenderObject;
  -using khtml::SharedPtr;
   
   @interface DOMAttr (WebCoreInternal)
   + (DOMAttr *)_attrWithImpl:(AttrImpl *)impl;
  
  
  
  1.7       +1 -1      WebCore/kwq/DOMEvents.mm
  
  Index: DOMEvents.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMEvents.mm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DOMEvents.mm	16 Sep 2005 22:42:23 -0000	1.6
  +++ DOMEvents.mm	27 Sep 2005 22:37:26 -0000	1.7
  @@ -28,7 +28,7 @@
   #import "DOMEventsInternal.h"
   #import "DOMViewsInternal.h"
   #import "DOMInternal.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   #import "dom_docimpl.h"
   #import "dom2_eventsimpl.h"
  
  
  
  1.30      +1 -1      WebCore/kwq/DOMHTML.mm
  
  Index: DOMHTML.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMHTML.mm,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- DOMHTML.mm	16 Sep 2005 22:42:23 -0000	1.29
  +++ DOMHTML.mm	27 Sep 2005 22:37:26 -0000	1.30
  @@ -45,7 +45,7 @@
   #import "DOMExtensions.h"
   #import "DOMInternal.h"
   #import "DOMHTMLInternal.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   
   using namespace DOM::HTMLNames;
  
  
  
  1.9       +1 -1      WebCore/kwq/DOMInternal.mm
  
  Index: DOMInternal.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMInternal.mm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMInternal.mm	29 Aug 2005 21:29:28 -0000	1.8
  +++ DOMInternal.mm	27 Sep 2005 22:37:26 -0000	1.9
  @@ -35,7 +35,7 @@
   #import "kjs_dom.h"
   #import "kjs_proxy.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQKHTMLPart.h"
   
   #import <JavaScriptCore/interpreter.h>
  
  
  
  1.2       +1 -1      WebCore/kwq/DOMViews.mm
  
  Index: DOMViews.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/DOMViews.mm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMViews.mm	23 May 2004 22:45:28 -0000	1.1
  +++ DOMViews.mm	27 Sep 2005 22:37:26 -0000	1.2
  @@ -27,7 +27,7 @@
   
   #import "DOMInternal.h"
   #import "DOMViewsInternal.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   #import "dom_docimpl.h"
   #import "dom2_viewsimpl.h"
  
  
  
  1.83      +1 -1      WebCore/kwq/KWQAccObject.mm
  
  Index: KWQAccObject.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQAccObject.mm,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- KWQAccObject.mm	24 Sep 2005 01:19:03 -0000	1.82
  +++ KWQAccObject.mm	27 Sep 2005 22:37:26 -0000	1.83
  @@ -31,7 +31,7 @@
   #include <mach-o/dyld.h>
   
   #import "KWQAccObjectCache.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQWidget.h"
   #import "WebCoreBridge.h"
  
  
  
  1.10      +1 -1      WebCore/kwq/KWQAccObjectCache.mm
  
  Index: KWQAccObjectCache.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQAccObjectCache.mm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- KWQAccObjectCache.mm	5 Jun 2005 07:06:52 -0000	1.9
  +++ KWQAccObjectCache.mm	27 Sep 2005 22:37:27 -0000	1.10
  @@ -26,7 +26,7 @@
   #import "KWQAccObjectCache.h"
   
   #import "KWQAccObject.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQString.h"
   #import "render_object.h"
  
  
  
  1.9       +2 -4      WebCore/kwq/KWQArrayImpl.h
  
  Index: KWQArrayImpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQArrayImpl.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- KWQArrayImpl.h	15 Aug 2005 00:32:40 -0000	1.8
  +++ KWQArrayImpl.h	27 Sep 2005 22:37:27 -0000	1.9
  @@ -29,7 +29,7 @@
   #include "KWQRefPtr.h"
   #include "KWQDef.h"
   #include <stddef.h>
  -#include "main_thread_malloc.h"
  +#include "kxmlcore/FastMalloc.h"
   
   class KWQArrayImpl
   {
  @@ -52,14 +52,12 @@
       bool operator==(const KWQArrayImpl &) const;
   
    private:
  -    class KWQArrayPrivate
  +    class KWQArrayPrivate : public FastAllocated
       {
       public:	
   	KWQArrayPrivate(size_t pNumItems, size_t pItemSize);
   	~KWQArrayPrivate();
   
  -        MAIN_THREAD_ALLOCATED;
  -
   	size_t numItems;
   	size_t itemSize;
   	char *data;
  
  
  
  1.13      +4 -7      WebCore/kwq/KWQArrayImpl.mm
  
  Index: KWQArrayImpl.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQArrayImpl.mm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- KWQArrayImpl.mm	18 Aug 2005 00:31:23 -0000	1.12
  +++ KWQArrayImpl.mm	27 Sep 2005 22:37:27 -0000	1.13
  @@ -31,21 +31,18 @@
   #define	MIN(a,b) (((a)<(b))?(a):(b))
   
   using std::nothrow;
  -using khtml::main_thread_malloc;
  -using khtml::main_thread_free;
  -using khtml::main_thread_realloc;
   
   KWQArrayImpl::KWQArrayPrivate::KWQArrayPrivate(size_t pItemSize, size_t pNumItems) : 
       numItems(pNumItems), 
       itemSize(pItemSize), 
  -    data(pNumItems > 0 ? static_cast<char *>(main_thread_malloc(itemSize * numItems)) : NULL), 
  +    data(pNumItems > 0 ? static_cast<char *>(fastMalloc(itemSize * numItems)) : NULL), 
       refCount(0)
   {
   }
   
   KWQArrayImpl::KWQArrayPrivate::~KWQArrayPrivate()
   {
  -    main_thread_free(data);
  +    fastFree(data);
   }
   
   
  @@ -80,13 +77,13 @@
           char *newData;
           
   	if (newSize != 0) {
  -	    newData = static_cast<char *>(main_thread_realloc(d->data, newSize * d->itemSize));
  +	    newData = static_cast<char *>(fastRealloc(d->data, newSize * d->itemSize));
   	    if (newData == NULL) {
   	        return false;
   	    }
   	} else {
   	    newData = NULL;
  -            main_thread_free(d->data);
  +            fastFree(d->data);
   	}
   
   	d->data = newData;
  
  
  
  1.45      +1 -1      WebCore/kwq/KWQButton.mm
  
  Index: KWQButton.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQButton.mm,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- KWQButton.mm	2 Aug 2005 20:28:40 -0000	1.44
  +++ KWQButton.mm	27 Sep 2005 22:37:27 -0000	1.45
  @@ -25,7 +25,7 @@
   
   #import "KWQButton.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQExceptions.h"
   #import "KWQKHTMLPart.h"
   #import "KWQNSViewExtras.h"
  
  
  
  1.18      +1 -1      WebCore/kwq/KWQCString.mm
  
  Index: KWQCString.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQCString.mm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- KWQCString.mm	10 May 2003 05:46:59 -0000	1.17
  +++ KWQCString.mm	27 Sep 2005 22:37:27 -0000	1.18
  @@ -25,7 +25,7 @@
   
   #import "KWQCString.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import <ctype.h>
   
   using std::ostream;
  
  
  
  1.8       +1 -1      WebCore/kwq/KWQClipboard.h
  
  Index: KWQClipboard.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQClipboard.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- KWQClipboard.h	10 May 2005 21:59:15 -0000	1.7
  +++ KWQClipboard.h	27 Sep 2005 22:37:27 -0000	1.8
  @@ -95,7 +95,7 @@
       DOM::DOMString m_effectAllowed;
       QPoint m_dragLoc;
       QPixmap m_dragImage;
  -    khtml::SharedPtr<DOM::NodeImpl> m_dragImageElement;
  +    SharedPtr<DOM::NodeImpl> m_dragImageElement;
       AccessPolicy m_policy;
       int m_changeCount;
       bool m_dragStarted;
  
  
  
  1.18      +1 -1      WebCore/kwq/KWQClipboard.mm
  
  Index: KWQClipboard.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQClipboard.mm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- KWQClipboard.mm	25 Aug 2005 17:47:25 -0000	1.17
  +++ KWQClipboard.mm	27 Sep 2005 22:37:27 -0000	1.18
  @@ -24,7 +24,7 @@
    */
   
   #import "KWQClipboard.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQKHTMLPart.h"
   #import "KWQStringList.h"
  
  
  
  1.45      +1 -1      WebCore/kwq/KWQColor.mm
  
  Index: KWQColor.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQColor.mm,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- KWQColor.mm	1 Aug 2005 09:06:33 -0000	1.44
  +++ KWQColor.mm	27 Sep 2005 22:37:27 -0000	1.45
  @@ -27,7 +27,7 @@
   
   #import "KWQNamespace.h"
   #import "KWQString.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQPainter.h"
   
   // NSColor calls don't throw, so no need to block Cocoa exceptions in this file
  
  
  
  1.66      +1 -1      WebCore/kwq/KWQComboBox.mm
  
  Index: KWQComboBox.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQComboBox.mm,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- KWQComboBox.mm	2 Sep 2005 21:34:47 -0000	1.65
  +++ KWQComboBox.mm	27 Sep 2005 22:37:27 -0000	1.66
  @@ -25,7 +25,7 @@
   
   #import "KWQComboBox.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQButton.h"
   #import "KWQExceptions.h"
   #import "KWQKHTMLPart.h"
  
  
  
  1.6       +1 -1      WebCore/kwq/KWQEditCommand.mm
  
  Index: KWQEditCommand.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQEditCommand.mm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- KWQEditCommand.mm	5 Oct 2004 07:01:21 -0000	1.5
  +++ KWQEditCommand.mm	27 Sep 2005 22:37:28 -0000	1.6
  @@ -25,7 +25,7 @@
   
   #import "KWQEditCommand.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   
   #import "htmlediting.h"
  
  
  
  1.4       +1 -1      WebCore/kwq/KWQExceptions.h
  
  Index: KWQExceptions.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQExceptions.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- KWQExceptions.h	27 Oct 2003 20:51:25 -0000	1.3
  +++ KWQExceptions.h	27 Sep 2005 22:37:28 -0000	1.4
  @@ -24,7 +24,7 @@
    */
   
   #import <Foundation/NSException.h>
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   class KWQNSHandler
   {
  
  
  
  1.28      +1 -1      WebCore/kwq/KWQFileButton.mm
  
  Index: KWQFileButton.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFileButton.mm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- KWQFileButton.mm	29 Apr 2005 00:31:01 -0000	1.27
  +++ KWQFileButton.mm	27 Sep 2005 22:37:28 -0000	1.28
  @@ -25,7 +25,7 @@
   
   #import "KWQFileButton.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQExceptions.h"
   #import "KWQKHTMLPart.h"
   #import "KWQNSViewExtras.h"
  
  
  
  1.5       +2 -4      WebCore/kwq/KWQFontFamily.h
  
  Index: KWQFontFamily.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFontFamily.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- KWQFontFamily.h	26 Apr 2005 18:46:04 -0000	1.4
  +++ KWQFontFamily.h	27 Sep 2005 22:37:28 -0000	1.5
  @@ -25,7 +25,7 @@
   
   #include "KWQString.h"
   #include "dom_atomicstring.h"
  -#include "misc/main_thread_malloc.h"
  +#include "kxmlcore/FastMalloc.h"
   
   #ifdef __OBJC__
   @class NSString;
  @@ -33,7 +33,7 @@
   class NSString;
   #endif
   
  -class KWQFontFamily {
  +class KWQFontFamily : public FastAllocated {
   public:
       KWQFontFamily();
       ~KWQFontFamily() { if (_next) _next->deref();  }
  @@ -41,8 +41,6 @@
       KWQFontFamily(const KWQFontFamily &);    
       KWQFontFamily &operator=(const KWQFontFamily &);
           
  -    MAIN_THREAD_ALLOCATED;
  -
       void setFamily(const DOM::AtomicString &);
       const DOM::AtomicString& family() const { return _family; }
       bool familyIsEmpty() const { return _family.isEmpty(); }
  
  
  
  1.3       +1 -1      WebCore/kwq/KWQFormData.mm
  
  Index: KWQFormData.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQFormData.mm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- KWQFormData.mm	6 Sep 2004 23:23:15 -0000	1.2
  +++ KWQFormData.mm	27 Sep 2005 22:37:28 -0000	1.3
  @@ -25,7 +25,7 @@
   
   #import "KWQFormData.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "formdata.h"
   
   using khtml::FormData;
  
  
  
  1.229     +3 -3      WebCore/kwq/KWQKHTMLPart.h
  
  Index: KWQKHTMLPart.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.h,v
  retrieving revision 1.228
  retrieving revision 1.229
  diff -u -r1.228 -r1.229
  --- KWQKHTMLPart.h	24 Sep 2005 01:19:04 -0000	1.228
  +++ KWQKHTMLPart.h	27 Sep 2005 22:37:28 -0000	1.229
  @@ -473,7 +473,7 @@
       WebScriptObject *_windowScriptObject;
       NPObject *_windowScriptNPObject;
       
  -    khtml::SharedPtr<DOM::NodeImpl> _dragSrc;     // element that may be a drag source, for the current mouse gesture
  +    SharedPtr<DOM::NodeImpl> _dragSrc;     // element that may be a drag source, for the current mouse gesture
       bool _dragSrcIsLink;
       bool _dragSrcIsImage;
       bool _dragSrcInSelection;
  @@ -481,9 +481,9 @@
       bool _dragSrcIsDHTML;
       KWQClipboard *_dragClipboard;   // used on only the source side of dragging
       
  -    mutable khtml::SharedPtr<DOM::NodeImpl> _elementToDraw;
  +    mutable SharedPtr<DOM::NodeImpl> _elementToDraw;
   
  -    khtml::SharedPtr<DOM::RangeImpl> m_markedTextRange;
  +    SharedPtr<DOM::RangeImpl> m_markedTextRange;
       bool m_markedTextUsesUnderlines;
       QValueList<MarkedTextUnderline> m_markedTextUnderlines;
   
  
  
  
  1.675     +0 -1      WebCore/kwq/KWQKHTMLPart.mm
  
  Index: KWQKHTMLPart.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPart.mm,v
  retrieving revision 1.674
  retrieving revision 1.675
  diff -u -r1.674 -r1.675
  --- KWQKHTMLPart.mm	24 Sep 2005 01:19:04 -0000	1.674
  +++ KWQKHTMLPart.mm	27 Sep 2005 22:37:28 -0000	1.675
  @@ -145,7 +145,6 @@
   using khtml::setEnd;
   using khtml::setStart;
   using khtml::ShadowData;
  -using khtml::SharedPtr;
   using khtml::startOfWord;
   using khtml::startVisiblePosition;
   using khtml::StyleDashboardRegion;
  
  
  
  1.14      +1 -1      WebCore/kwq/KWQKPartsBrowserInterface.mm
  
  Index: KWQKPartsBrowserInterface.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKPartsBrowserInterface.mm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- KWQKPartsBrowserInterface.mm	16 Nov 2003 21:25:23 -0000	1.13
  +++ KWQKPartsBrowserInterface.mm	27 Sep 2005 22:37:29 -0000	1.14
  @@ -25,7 +25,7 @@
   
   #import "KWQKPartsBrowserInterface.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQExceptions.h"
   #import "KWQKHTMLPart.h"
   #import "WebCoreBridge.h"
  
  
  
  1.92      +1 -1      WebCore/kwq/KWQKURL.mm
  
  Index: KWQKURL.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQKURL.mm,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- KWQKURL.mm	24 Jun 2005 16:48:39 -0000	1.91
  +++ KWQKURL.mm	27 Sep 2005 22:37:29 -0000	1.92
  @@ -25,7 +25,7 @@
   
   #import "KWQKURL.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQRegExp.h"
   #import "KWQTextCodec.h"
  
  
  
  1.58      +1 -1      WebCore/kwq/KWQListBox.mm
  
  Index: KWQListBox.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQListBox.mm,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- KWQListBox.mm	2 Sep 2005 21:34:48 -0000	1.57
  +++ KWQListBox.mm	27 Sep 2005 22:37:29 -0000	1.58
  @@ -25,7 +25,7 @@
   
   #import "KWQListBox.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQExceptions.h"
   #import "KWQKHTMLPart.h"
   #import "KWQNSViewExtras.h"
  
  
  
  1.22      +3 -5      WebCore/kwq/KWQListImpl.mm
  
  Index: KWQListImpl.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQListImpl.mm,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- KWQListImpl.mm	3 Jul 2005 09:45:08 -0000	1.21
  +++ KWQListImpl.mm	27 Sep 2005 22:37:30 -0000	1.22
  @@ -28,16 +28,14 @@
   #import <cstddef>
   #import <algorithm>
   #import <CoreFoundation/CFArray.h>
  -#import "KWQAssertions.h"
  -#import "misc/main_thread_malloc.h"
  +#import <kxmlcore/Assertions.h>
  +#import "kxmlcore/FastMalloc.h"
   
  -class KWQListNode
  +class KWQListNode : public FastAllocated
   {
   public:
       KWQListNode(void *d) : data(d), next(NULL), prev(NULL) { }
   
  -    MAIN_THREAD_ALLOCATED;
  -
       void *data;
       KWQListNode *next;
       KWQListNode *prev;
  
  
  
  1.10      +8 -8      WebCore/kwq/KWQLogging.h
  
  Index: KWQLogging.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQLogging.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- KWQLogging.h	11 Jul 2005 23:12:01 -0000	1.9
  +++ KWQLogging.h	27 Sep 2005 22:37:30 -0000	1.10
  @@ -23,17 +23,17 @@
    * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    */
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   #ifndef LOG_CHANNEL_PREFIX
   #define LOG_CHANNEL_PREFIX KWQLog
   #endif
   
  -extern KWQLogChannel KWQLogNotYetImplemented;
  +extern KXCLogChannel KWQLogNotYetImplemented;
   
  -extern KWQLogChannel KWQLogFrames;
  -extern KWQLogChannel KWQLogLoading;
  -extern KWQLogChannel KWQLogPopupBlocking;
  -extern KWQLogChannel KWQLogEvents;
  -extern KWQLogChannel KWQLogEditing;
  -extern KWQLogChannel KWQLogTextConversion;
  +extern KXCLogChannel KWQLogFrames;
  +extern KXCLogChannel KWQLogLoading;
  +extern KXCLogChannel KWQLogPopupBlocking;
  +extern KXCLogChannel KWQLogEvents;
  +extern KXCLogChannel KWQLogEditing;
  +extern KXCLogChannel KWQLogTextConversion;
  
  
  
  1.9       +7 -7      WebCore/kwq/KWQLogging.m
  
  Index: KWQLogging.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQLogging.m,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- KWQLogging.m	11 Jul 2005 23:12:01 -0000	1.8
  +++ KWQLogging.m	27 Sep 2005 22:37:30 -0000	1.9
  @@ -25,13 +25,13 @@
   
   #import "KWQLogging.h"
   
  -KWQLogChannel KWQLogNotYetImplemented = { 0x00000001, "WebCoreLogLevel", KWQLogChannelUninitialized };
  +KXCLogChannel KWQLogNotYetImplemented = { 0x00000001, "WebCoreLogLevel", KXCLogChannelUninitialized };
   
  -KWQLogChannel KWQLogFrames =            { 0x00000010, "WebCoreLogLevel", KWQLogChannelUninitialized };
  -KWQLogChannel KWQLogLoading =           { 0x00000020, "WebCoreLogLevel", KWQLogChannelUninitialized };
  +KXCLogChannel KWQLogFrames =            { 0x00000010, "WebCoreLogLevel", KXCLogChannelUninitialized };
  +KXCLogChannel KWQLogLoading =           { 0x00000020, "WebCoreLogLevel", KXCLogChannelUninitialized };
   
  -KWQLogChannel KWQLogPopupBlocking =     { 0x00000040, "WebCoreLogLevel", KWQLogChannelUninitialized };
  +KXCLogChannel KWQLogPopupBlocking =     { 0x00000040, "WebCoreLogLevel", KXCLogChannelUninitialized };
   
  -KWQLogChannel KWQLogEvents =            { 0x00000080, "WebCoreLogLevel", KWQLogChannelUninitialized };
  -KWQLogChannel KWQLogEditing =           { 0x00000100, "WebCoreLogLevel", KWQLogChannelUninitialized };
  -KWQLogChannel KWQLogTextConversion =    { 0x00000200, "WebCoreLogLevel", KWQLogChannelUninitialized };
  +KXCLogChannel KWQLogEvents =            { 0x00000080, "WebCoreLogLevel", KXCLogChannelUninitialized };
  +KXCLogChannel KWQLogEditing =           { 0x00000100, "WebCoreLogLevel", KXCLogChannelUninitialized };
  +KXCLogChannel KWQLogTextConversion =    { 0x00000200, "WebCoreLogLevel", KXCLogChannelUninitialized };
  
  
  
  1.10      +3 -9      WebCore/kwq/KWQMapImpl.h
  
  Index: KWQMapImpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQMapImpl.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- KWQMapImpl.h	15 Aug 2005 00:32:40 -0000	1.9
  +++ KWQMapImpl.h	27 Sep 2005 22:37:30 -0000	1.10
  @@ -29,15 +29,12 @@
   #include <new>
   
   #include "KWQRefPtr.h"
  -#include "main_thread_malloc.h"
  +#include "kxmlcore/FastMalloc.h"
   
   class KWQMapImpl;
   
  -class KWQMapNodeImpl
  +class KWQMapNodeImpl : public FastAllocated
   {
  -public:
  -    MAIN_THREAD_ALLOCATED;
  -
   protected:
       typedef enum { Red = 0, Black = 1 } KWQMapNodeColor;
   
  @@ -67,10 +64,7 @@
   #endif
   };
   
  -class KWQMapIteratorImpl {
  -public:
  -    MAIN_THREAD_ALLOCATED;
  -
  +class KWQMapIteratorImpl : public FastAllocated {
   protected:
       KWQMapNodeImpl *node;
   
  
  
  
  1.11      +1 -3      WebCore/kwq/KWQMapImpl.mm
  
  Index: KWQMapImpl.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQMapImpl.mm,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- KWQMapImpl.mm	15 Aug 2005 00:32:40 -0000	1.10
  +++ KWQMapImpl.mm	27 Sep 2005 22:37:30 -0000	1.11
  @@ -115,7 +115,7 @@
   
   // KWQMapImplPrivate
   
  -class KWQMapImpl::KWQMapPrivate
  +class KWQMapImpl::KWQMapPrivate : public FastAllocated
   {
   public:
       KWQMapPrivate(KWQMapNodeImpl *node,
  @@ -124,8 +124,6 @@
   
       ~KWQMapPrivate();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       KWQMapNodeImpl *guard;
       uint numNodes;
       int refCount;
  
  
  
  1.47      +1 -1      WebCore/kwq/KWQObject.mm
  
  Index: KWQObject.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQObject.mm,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- KWQObject.mm	18 May 2005 21:10:26 -0000	1.46
  +++ KWQObject.mm	27 Sep 2005 22:37:30 -0000	1.47
  @@ -26,7 +26,7 @@
   #import "KWQObject.h"
   
   #import "KWQVariant.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   // The Foundation-level Cocoa calls here (NSTimer, NSDate, NSArray,
   // NSDictionary) should be exception-free, so no need to block
  
  
  
  1.20      +1 -1      WebCore/kwq/KWQPageState.mm
  
  Index: KWQPageState.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQPageState.mm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- KWQPageState.mm	19 Sep 2005 18:52:13 -0000	1.19
  +++ KWQPageState.mm	27 Sep 2005 22:37:30 -0000	1.20
  @@ -32,7 +32,7 @@
   #import "khtmlview.h"
   #import "kjs_window.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQFoundationExtras.h"
   #import "KWQKHTMLPart.h"
   
  
  
  
  1.143     +1 -1      WebCore/kwq/KWQPainter.mm
  
  Index: KWQPainter.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQPainter.mm,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- KWQPainter.mm	24 Sep 2005 11:45:18 -0000	1.142
  +++ KWQPainter.mm	27 Sep 2005 22:37:30 -0000	1.143
  @@ -25,7 +25,7 @@
   
   #import "KWQPainter.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQBrush.h"
   #import "KWQExceptions.h"
   #import "KWQFoundationExtras.h"
  
  
  
  1.16      +1 -1      WebCore/kwq/KWQResourceLoader.mm
  
  Index: KWQResourceLoader.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQResourceLoader.mm,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- KWQResourceLoader.mm	8 Sep 2005 21:35:30 -0000	1.15
  +++ KWQResourceLoader.mm	27 Sep 2005 22:37:31 -0000	1.16
  @@ -25,7 +25,7 @@
   
   #import "KWQResourceLoader.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQKJobClasses.h"
   #import "loader.h"
   
  
  
  
  1.20      +1 -1      WebCore/kwq/KWQSignal.mm
  
  Index: KWQSignal.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQSignal.mm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- KWQSignal.mm	14 Jul 2005 02:32:33 -0000	1.19
  +++ KWQSignal.mm	27 Sep 2005 22:37:31 -0000	1.20
  @@ -26,7 +26,7 @@
   #import "KWQSignal.h"
   
   #import "KWQObject.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   using KIO::Job;
   
  
  
  
  1.34      +1 -1      WebCore/kwq/KWQSlot.mm
  
  Index: KWQSlot.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQSlot.mm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- KWQSlot.mm	1 Sep 2005 18:57:53 -0000	1.33
  +++ KWQSlot.mm	27 Sep 2005 22:37:31 -0000	1.34
  @@ -25,7 +25,7 @@
   
   #import "KWQSlot.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   #import "dom_docimpl.h"
   #import "khtml_part.h"
  
  
  
  1.118     +6 -4      WebCore/kwq/KWQString.h
  
  Index: KWQString.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQString.h,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- KWQString.h	16 Sep 2005 22:42:23 -0000	1.117
  +++ KWQString.h	27 Sep 2005 22:37:31 -0000	1.118
  @@ -28,7 +28,7 @@
   
   #include <unicode/uchar.h>
   #include <CoreFoundation/CoreFoundation.h>
  -#include "misc/main_thread_malloc.h"
  +#include "kxmlcore/FastMalloc.h"
   #include "KWQCString.h"
   
   // Make htmltokenizer.cpp happy
  @@ -340,7 +340,11 @@
   #define QS_INTERNAL_BUFFER_CHARS QS_INTERNAL_BUFFER_SIZE-1
   #define QS_INTERNAL_BUFFER_UCHARS QS_INTERNAL_BUFFER_SIZE/2
   
  -struct KWQStringData {
  +struct KWQStringData 
  +#ifndef QSTRING_DEBUG_ALLOCATIONS
  +    : public FastAllocated 
  +#endif
  +{
       // Uses shared null data.
       KWQStringData();
       void initialize();
  @@ -365,8 +369,6 @@
   #ifdef QSTRING_DEBUG_ALLOCATIONS
       void* operator new(size_t s);
       void operator delete(void*p);
  -#else
  -    MAIN_THREAD_ALLOCATED;
   #endif
   
       inline void ref() { refCount++; }
  
  
  
  1.141     +12 -16    WebCore/kwq/KWQString.mm
  
  Index: KWQString.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQString.mm,v
  retrieving revision 1.140
  retrieving revision 1.141
  diff -u -r1.140 -r1.141
  --- KWQString.mm	16 Sep 2005 22:42:24 -0000	1.140
  +++ KWQString.mm	27 Sep 2005 22:37:31 -0000	1.141
  @@ -33,11 +33,7 @@
   #import "KWQString.h"
   #import "KWQRegExp.h"
   #import "KWQTextCodec.h"
  -#import "misc/main_thread_malloc.h"
  -
  -using khtml::main_thread_malloc;
  -using khtml::main_thread_realloc;
  -using khtml::main_thread_free;
  +#import "kxmlcore/FastMalloc.h"
   
   #define CHECK_FOR_HANDLE_LEAKS 0
   
  @@ -127,7 +123,7 @@
   static QChar *ALLOC_QCHAR(int n)
   {
       size_t size = (sizeof(QChar)*( n ));
  -    QChar *ptr = (QChar *)main_thread_malloc(size);
  +    QChar *ptr = (QChar *)fast_malloc(size);
   
       CFDictionarySetValue (allocatedBuffers(), ptr, (const void *)size);
       if (size >= ALLOCATION_HISTOGRAM_SIZE)
  @@ -207,13 +203,13 @@
   
   #else
   
  -#define ALLOC_CHAR( N ) (char*) main_thread_malloc(N)
  -#define REALLOC_CHAR( P, N ) (char *) main_thread_realloc(P,N)
  -#define DELETE_CHAR( P ) main_thread_free(P)
  -
  -#define ALLOC_QCHAR( N ) (QChar*) main_thread_malloc(sizeof(QChar)*( N ))
  -#define REALLOC_QCHAR( P, N ) (QChar *) main_thread_realloc(P,sizeof(QChar)*( N ))
  -#define DELETE_QCHAR( P ) main_thread_free( P )
  +#define ALLOC_CHAR(N) (char*) fastMalloc(N)
  +#define REALLOC_CHAR(P, N) (char *) fastRealloc(P, N)
  +#define DELETE_CHAR(P) fastFree(P)
  +
  +#define ALLOC_QCHAR(N) (QChar*)fastMalloc(sizeof(QChar)*(N))
  +#define REALLOC_QCHAR(P, N) (QChar *)fastRealloc(P, sizeof(QChar)*(N))
  +#define DELETE_QCHAR(P) fastFree(P)
   
   #endif // QSTRING_DEBUG_ALLOCATIONS
   
  @@ -758,14 +754,14 @@
       UniChar fixedSizeBuffer[1024];
       UniChar *buffer;
       if (size > (CFIndex)(sizeof(fixedSizeBuffer) / sizeof(UniChar))) {
  -        buffer = (UniChar *)main_thread_malloc(size * sizeof(UniChar));
  +        buffer = (UniChar *)fastMalloc(size * sizeof(UniChar));
       } else {
           buffer = fixedSizeBuffer;
       }
       CFStringGetCharacters(cfs, CFRangeMake (0, size), buffer);
       setUnicode((const QChar *)buffer, (uint)size);
       if (buffer != fixedSizeBuffer) {
  -        main_thread_free(buffer);
  +        fastFree(buffer);
       }
   }
   
  @@ -2902,7 +2898,7 @@
   
   static HandlePageNode *allocatePageNode()
   {
  -    HandlePageNode *node = (HandlePageNode *)main_thread_malloc(sizeof(HandlePageNode));
  +    HandlePageNode *node = (HandlePageNode *)fastMalloc(sizeof(HandlePageNode));
       node->next = node->previous = 0;
       node->nodes = initializeHandleNodeBlock(node);
       return node;
  
  
  
  1.90      +1 -1      WebCore/kwq/KWQTextArea.mm
  
  Index: KWQTextArea.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextArea.mm,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- KWQTextArea.mm	31 Aug 2005 04:38:44 -0000	1.89
  +++ KWQTextArea.mm	27 Sep 2005 22:37:32 -0000	1.90
  @@ -28,7 +28,7 @@
   #import "DOMCSS.h"
   #import "DOMHTML.h"
   #import "EventNames.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQKHTMLPart.h"
   #import "KWQNSViewExtras.h"
   #import "KWQTextEdit.h"
  
  
  
  1.55      +1 -1      WebCore/kwq/KWQTextCodec.mm
  
  Index: KWQTextCodec.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextCodec.mm,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- KWQTextCodec.mm	12 Jul 2005 16:37:26 -0000	1.54
  +++ KWQTextCodec.mm	27 Sep 2005 22:37:32 -0000	1.55
  @@ -25,7 +25,7 @@
   
   #import "KWQTextCodec.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQCharsets.h"
   #import "KWQLogging.h"
   
  
  
  
  1.53      +1 -1      WebCore/kwq/KWQTextEdit.mm
  
  Index: KWQTextEdit.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextEdit.mm,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- KWQTextEdit.mm	24 Sep 2005 11:05:34 -0000	1.52
  +++ KWQTextEdit.mm	27 Sep 2005 22:37:32 -0000	1.53
  @@ -25,7 +25,7 @@
   
   #import "KWQTextEdit.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQExceptions.h"
   #import "KWQLineEdit.h"
   #import "KWQPalette.h"
  
  
  
  1.89      +1 -1      WebCore/kwq/KWQTextField.mm
  
  Index: KWQTextField.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTextField.mm,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- KWQTextField.mm	8 Sep 2005 18:05:21 -0000	1.88
  +++ KWQTextField.mm	27 Sep 2005 22:37:32 -0000	1.89
  @@ -25,7 +25,7 @@
   
   #import "KWQTextField.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQKHTMLPart.h"
   #import "KWQLineEdit.h"
   #import "KWQNSViewExtras.h"
  
  
  
  1.18      +1 -1      WebCore/kwq/KWQTimer.mm
  
  Index: KWQTimer.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQTimer.mm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- KWQTimer.mm	19 Sep 2005 18:52:13 -0000	1.17
  +++ KWQTimer.mm	27 Sep 2005 22:37:32 -0000	1.18
  @@ -25,7 +25,7 @@
   
   #import "KWQTimer.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQLogging.h"
   #import "KWQFoundationExtras.h"
   
  
  
  
  1.12      +2 -5      WebCore/kwq/KWQValueListImpl.h
  
  Index: KWQValueListImpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQValueListImpl.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- KWQValueListImpl.h	15 Aug 2005 00:32:40 -0000	1.11
  +++ KWQValueListImpl.h	27 Sep 2005 22:37:32 -0000	1.12
  @@ -28,7 +28,7 @@
   
   #include "KWQRefPtr.h"
   #include "KWQDef.h"
  -#include "main_thread_malloc.h"
  +#include "kxmlcore/FastMalloc.h"
   
   class KWQValueListNodeImpl;
   
  @@ -107,11 +107,8 @@
       friend class KWQValueListNodeImpl;
   };
   
  -class KWQValueListNodeImpl
  +class KWQValueListNodeImpl : public FastAllocated
   {
  -public:
  -    MAIN_THREAD_ALLOCATED;
  -
   protected:
       KWQValueListNodeImpl();
   
  
  
  
  1.14      +1 -3      WebCore/kwq/KWQValueListImpl.mm
  
  Index: KWQValueListImpl.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/KWQValueListImpl.mm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- KWQValueListImpl.mm	15 Aug 2005 00:32:41 -0000	1.13
  +++ KWQValueListImpl.mm	27 Sep 2005 22:37:32 -0000	1.14
  @@ -27,7 +27,7 @@
   
   #import <stdlib.h>
   
  -class KWQValueListImpl::KWQValueListPrivate
  +class KWQValueListImpl::KWQValueListPrivate : public FastAllocated
   {
   public:
       KWQValueListPrivate(void (*deleteFunc)(KWQValueListNodeImpl *), KWQValueListNodeImpl *(*copyFunc)(KWQValueListNodeImpl *));
  @@ -35,8 +35,6 @@
   
       ~KWQValueListPrivate();
   
  -    MAIN_THREAD_ALLOCATED;
  -
       void copyList(KWQValueListNodeImpl *l, KWQValueListNodeImpl *&head, KWQValueListNodeImpl *&tail) const;
       void deleteList(KWQValueListNodeImpl *l);
   
  
  
  
  1.418     +1 -2      WebCore/kwq/WebCoreBridge.mm
  
  Index: WebCoreBridge.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreBridge.mm,v
  retrieving revision 1.417
  retrieving revision 1.418
  diff -u -r1.417 -r1.418
  --- WebCoreBridge.mm	24 Sep 2005 01:19:06 -0000	1.417
  +++ WebCoreBridge.mm	27 Sep 2005 22:37:32 -0000	1.418
  @@ -63,7 +63,7 @@
   #import <JavaScriptCore/property_map.h>
   #import <JavaScriptCore/runtime_root.h>
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQCharsets.h"
   #import "KWQClipboard.h"
   #import "KWQEditCommand.h"
  @@ -124,7 +124,6 @@
   using khtml::RenderWidget;
   using khtml::ReplaceSelectionCommand;
   using khtml::SelectionController;
  -using khtml::SharedPtr;
   using khtml::Tokenizer;
   using khtml::TextIterator;
   using khtml::TypingCommand;
  
  
  
  1.7       +1 -1      WebCore/kwq/WebCoreCookieAdapter.m
  
  Index: WebCoreCookieAdapter.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreCookieAdapter.m,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WebCoreCookieAdapter.m	22 Jan 2003 00:12:36 -0000	1.6
  +++ WebCoreCookieAdapter.m	27 Sep 2005 22:37:33 -0000	1.7
  @@ -24,7 +24,7 @@
    */
   
   #import "WebCoreCookieAdapter.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   @implementation WebCoreCookieAdapter
   
  
  
  
  1.7       +1 -1      WebCore/kwq/WebCoreGraphicsBridge.m
  
  Index: WebCoreGraphicsBridge.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreGraphicsBridge.m,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WebCoreGraphicsBridge.m	16 Aug 2005 17:36:32 -0000	1.6
  +++ WebCoreGraphicsBridge.m	27 Sep 2005 22:37:33 -0000	1.7
  @@ -25,7 +25,7 @@
   
   #import "WebCoreGraphicsBridge.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   @implementation WebCoreGraphicsBridge
   
  
  
  
  1.10      +1 -1      WebCore/kwq/WebCoreImageRendererFactory.m
  
  Index: WebCoreImageRendererFactory.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreImageRendererFactory.m,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WebCoreImageRendererFactory.m	10 Dec 2004 04:38:19 -0000	1.9
  +++ WebCoreImageRendererFactory.m	27 Sep 2005 22:37:33 -0000	1.10
  @@ -24,7 +24,7 @@
    */
   
   #import "WebCoreImageRendererFactory.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQRenderTreeDebug.h"
   
   @implementation WebCoreImageRendererFactory
  
  
  
  1.4       +1 -1      WebCore/kwq/WebCoreKeyGenerator.m
  
  Index: WebCoreKeyGenerator.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreKeyGenerator.m,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebCoreKeyGenerator.m	19 May 2004 14:37:10 -0000	1.3
  +++ WebCoreKeyGenerator.m	27 Sep 2005 22:37:33 -0000	1.4
  @@ -25,7 +25,7 @@
   
   #import "WebCoreKeyGenerator.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   static WebCoreKeyGenerator *sharedGenerator;
   
  
  
  
  1.26      +1 -1      WebCore/kwq/WebCoreTextRendererFactory.mm
  
  Index: WebCoreTextRendererFactory.mm
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreTextRendererFactory.mm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- WebCoreTextRendererFactory.mm	24 Sep 2005 11:45:19 -0000	1.25
  +++ WebCoreTextRendererFactory.mm	27 Sep 2005 22:37:33 -0000	1.26
  @@ -26,7 +26,7 @@
   #import "WebCoreTextRenderer.h"
   #import "WebCoreTextRendererFactory.h"
   
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   #import "KWQKHTMLPart.h"
   #import "KWQListBox.h"
   #import "WebCoreBridge.h"
  
  
  
  1.12      +1 -1      WebCore/kwq/WebCoreViewFactory.m
  
  Index: WebCoreViewFactory.m
  ===================================================================
  RCS file: /cvs/root/WebCore/kwq/WebCoreViewFactory.m,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WebCoreViewFactory.m	11 Dec 2003 02:20:42 -0000	1.11
  +++ WebCoreViewFactory.m	27 Sep 2005 22:37:33 -0000	1.12
  @@ -23,7 +23,7 @@
    * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    */
   #import "WebCoreViewFactory.h"
  -#import "KWQAssertions.h"
  +#import <kxmlcore/Assertions.h>
   
   @implementation WebCoreViewFactory
   
  
  
  



More information about the webkit-changes mailing list