You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2005/12/20 14:18:55 UTC

svn commit: r357986 - in /xerces/c/trunk/src: ./ xercesc/dom/ xercesc/dom/impl/ xercesc/util/

Author: amassari
Date: Tue Dec 20 05:18:29 2005
New Revision: 357986

URL: http://svn.apache.org/viewcvs?rev=357986&view=rev
Log:
Expose the memory allocation functionalities of DOMDocumentImpl through the DOMMemoryManager interface; this removes dangerous casts in the operator new and allows to tune the size of the memory chunks (jira# 1475)

Added:
    xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp   (with props)
Modified:
    xerces/c/trunk/src/Makefile.am
    xerces/c/trunk/src/Makefile.in
    xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMAttrNSImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMCommentImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.hpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMEntityImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMNotationImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMTextImpl.cpp
    xerces/c/trunk/src/xercesc/util/XMLUni.cpp
    xerces/c/trunk/src/xercesc/util/XMLUni.hpp

Modified: xerces/c/trunk/src/Makefile.am
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/Makefile.am?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.am (original)
+++ xerces/c/trunk/src/Makefile.am Tue Dec 20 05:18:29 2005
@@ -283,6 +283,7 @@
 	xercesc/dom/DOMLSResourceResolver.hpp \
 	xercesc/dom/DOMLSSerializer.hpp \
 	xercesc/dom/DOMLSSerializerFilter.hpp \
+	xercesc/dom/DOMMemoryManager.hpp \
 	xercesc/dom/DOMNamedNodeMap.hpp \
 	xercesc/dom/DOMNode.hpp \
 	xercesc/dom/DOMNodeFilter.hpp \

Modified: xerces/c/trunk/src/Makefile.in
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/Makefile.in?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.in (original)
+++ xerces/c/trunk/src/Makefile.in Tue Dec 20 05:18:29 2005
@@ -1137,6 +1137,7 @@
 	xercesc/dom/DOMLSResourceResolver.hpp \
 	xercesc/dom/DOMLSSerializer.hpp \
 	xercesc/dom/DOMLSSerializerFilter.hpp \
+	xercesc/dom/DOMMemoryManager.hpp \
 	xercesc/dom/DOMNamedNodeMap.hpp \
 	xercesc/dom/DOMNode.hpp \
 	xercesc/dom/DOMNodeFilter.hpp \

Added: xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp?rev=357986&view=auto
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp (added)
+++ xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp Tue Dec 20 05:18:29 2005
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2001-2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#if !defined(DOMMEMORYMANAGER_HPP)
+#define DOMMEMORYMANAGER_HPP
+
+//------------------------------------------------------------------------------------
+//  Includes
+//------------------------------------------------------------------------------------
+
+XERCES_CPP_NAMESPACE_BEGIN
+
+/**
+  * The <code>DOMMemoryManager</code> interface exposes the memory allocation-related
+  * functionalities of a <code>DOMDocument</code>
+  */
+
+class CDOM_EXPORT DOMMemoryManager
+{
+protected:
+    // -----------------------------------------------------------------------
+    //  Hidden constructors
+    // -----------------------------------------------------------------------
+    /** @name Hidden constructors */
+    //@{
+    DOMMemoryManager() {};
+    //@}
+
+private:
+    // -----------------------------------------------------------------------
+    // Unimplemented constructors and operators
+    // -----------------------------------------------------------------------
+    /** @name Unimplemented constructors and operators */
+    //@{
+    DOMMemoryManager(const DOMMemoryManager &);
+    DOMMemoryManager & operator = (const DOMMemoryManager &);
+    //@}
+
+public:
+
+    // -----------------------------------------------------------------------
+    //  All constructors are hidden, just the destructor is available
+    // -----------------------------------------------------------------------
+    /** @name Destructor */
+    //@{
+    /**
+     * Destructor
+     *
+     */
+    virtual ~DOMMemoryManager() {};
+    //@}
+
+    // -----------------------------------------------------------------------
+    //  data types
+    // -----------------------------------------------------------------------
+    enum NodeObjectType {
+        ATTR_OBJECT                   = 0,
+        ATTR_NS_OBJECT                = 1,
+        CDATA_SECTION_OBJECT          = 2,
+        COMMENT_OBJECT                = 3,
+        DOCUMENT_FRAGMENT_OBJECT      = 4,
+        DOCUMENT_TYPE_OBJECT          = 5,
+        ELEMENT_OBJECT                = 6,
+        ELEMENT_NS_OBJECT             = 7,
+        ENTITY_OBJECT                 = 8,
+        ENTITY_REFERENCE_OBJECT       = 9,
+        NOTATION_OBJECT               = 10,
+        PROCESSING_INSTRUCTION_OBJECT = 11,
+        TEXT_OBJECT                   = 12
+    };
+
+    //@{
+    // -----------------------------------------------------------------------
+    //  Getter methods
+    // -----------------------------------------------------------------------
+    /**
+     * Returns the size of the chunks of memory allocated by the memory manager
+     *
+     * @return the dimension of the chunks of memory allocated by the memory manager
+     */
+    virtual XMLSize_t getMemoryAllocationBlockSize() const = 0;
+
+    //@}
+
+    //@{
+    // -----------------------------------------------------------------------
+    //  Setter methods
+    // -----------------------------------------------------------------------
+    /**
+     * Set the size of the chunks of memory allocated by the memory manager
+     *
+     * @param size the new size of the chunks; it must be greater than 4KB
+     */
+    virtual void setMemoryAllocationBlockSize(XMLSize_t size) = 0;
+    //@}
+
+    //@{
+    // -----------------------------------------------------------------------
+    //  Operations
+    // -----------------------------------------------------------------------
+    /**
+     * Allocate a memory block of the requested size from the managed pool
+     *
+     * @param amount the size of the new memory block
+     *
+     * @return the pointer to the newly allocated block
+     */
+    virtual void* allocate(XMLSize_t amount) = 0;
+
+    /**
+     * Allocate a memory block of the requested size from the managed pool of DOM objects
+     *
+     * @param amount the size of the new memory block
+     * @param type   the type of the DOM object that will be stored in the block
+     *
+     * @return the pointer to the newly allocated block
+     */
+    virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type) = 0;
+
+    /**
+     * Release a DOM object and place its memory back in the pool
+     *
+     * @param object the pointer to the DOM node
+     * @param type   the type of the DOM object 
+     */
+    virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type) = 0;
+
+    /**
+     * Allocate a memory block from the mnaged pool and copy the provided string
+     *
+     * @param src the string to be copied
+     *
+     * @return the pointer to the newly allocated block
+     */    
+    virtual XMLCh* cloneString(const XMLCh *src) = 0;
+    //@}
+
+};
+
+XERCES_CPP_NAMESPACE_END
+
+#endif
+
+/**
+ * End of file DOMMemoryManager.hpp
+ */

Propchange: xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xerces/c/trunk/src/xercesc/dom/DOMMemoryManager.hpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMAttrImpl.cpp Tue Dec 20 05:18:29 2005
@@ -226,7 +226,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ATTR_OBJECT);
+        doc->release(this, DOMMemoryManager::ATTR_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMAttrNSImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMAttrNSImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMAttrNSImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMAttrNSImpl.cpp Tue Dec 20 05:18:29 2005
@@ -56,7 +56,7 @@
 
 DOMNode * DOMAttrNSImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ATTR_NS_OBJECT) DOMAttrNSImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::ATTR_NS_OBJECT) DOMAttrNSImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -144,7 +144,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ATTR_NS_OBJECT);
+        doc->release(this, DOMMemoryManager::ATTR_NS_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMCDATASectionImpl.cpp Tue Dec 20 05:18:29 2005
@@ -54,7 +54,7 @@
 
 DOMNode  *DOMCDATASectionImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (this->getOwnerDocument(), DOMDocumentImpl::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(*this, deep);
+    DOMNode* newNode = new (this->getOwnerDocument(), DOMMemoryManager::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -145,7 +145,7 @@
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
         fCharacterData.releaseBuffer();
-        doc->release(this, DOMDocumentImpl::CDATA_SECTION_OBJECT);
+        doc->release(this, DOMMemoryManager::CDATA_SECTION_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMCommentImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMCommentImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMCommentImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMCommentImpl.cpp Tue Dec 20 05:18:29 2005
@@ -54,7 +54,7 @@
 
 DOMNode * DOMCommentImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::COMMENT_OBJECT) DOMCommentImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::COMMENT_OBJECT) DOMCommentImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -79,7 +79,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fCharacterData.releaseBuffer();
-        doc->release(this, DOMDocumentImpl::COMMENT_OBJECT);
+        doc->release(this, DOMMemoryManager::COMMENT_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentFragmentImpl.cpp Tue Dec 20 05:18:29 2005
@@ -50,7 +50,7 @@
 
 DOMNode *DOMDocumentFragmentImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(*this, deep);
+    DOMNode* newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -84,7 +84,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT);
+        doc->release(this, DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.cpp Tue Dec 20 05:18:29 2005
@@ -49,6 +49,13 @@
 
 XERCES_CPP_NAMESPACE_BEGIN
 
+// The chunk size to allocate from the system allocator.
+static const XMLSize_t kInitialHeapAllocSize =  0x2000;
+static const XMLSize_t kMaxHeapAllocSize     = 0x10000;
+static const XMLSize_t kMaxSubAllocationSize =  0x1000;  // Any request for more bytes
+                                                         // than this will be handled by
+                                                         // allocating directly with system.
+
 
 //
 //   Constructors.   Warning - be very careful with the ordering of initialization
@@ -75,6 +82,7 @@
       fCurrentBlock(0),      
       fFreePtr(0),
       fFreeBytesRemaining(0),
+      fHeapAllocSize(kInitialHeapAllocSize),
       fRecycleNodePtr(0),
       fRecycleBufferPtr(0),
       fNodeListPool(0),
@@ -111,6 +119,7 @@
       fCurrentBlock(0),      
       fFreePtr(0),
       fFreeBytesRemaining(0),
+      fHeapAllocSize(kInitialHeapAllocSize),
       fRecycleNodePtr(0),
       fRecycleBufferPtr(0),
       fNodeListPool(0),
@@ -242,27 +251,27 @@
 {
     if(!nam || !isXMLName(nam))
         throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager());
-    return new (this, DOMDocumentImpl::ATTR_OBJECT) DOMAttrImpl(this,nam);
+    return new (this, DOMMemoryManager::ATTR_OBJECT) DOMAttrImpl(this,nam);
 }
 
 
 
 DOMCDATASection *DOMDocumentImpl::createCDATASection(const XMLCh *data) {
-    return new (this, DOMDocumentImpl::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(this,data);
+    return new (this, DOMMemoryManager::CDATA_SECTION_OBJECT) DOMCDATASectionImpl(this,data);
 }
 
 
 
 DOMComment *DOMDocumentImpl::createComment(const XMLCh *data)
 {
-    return new (this, DOMDocumentImpl::COMMENT_OBJECT) DOMCommentImpl(this, data);
+    return new (this, DOMMemoryManager::COMMENT_OBJECT) DOMCommentImpl(this, data);
 }
 
 
 
 DOMDocumentFragment *DOMDocumentImpl::createDocumentFragment()
 {
-    return new (this, DOMDocumentImpl::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(this);
+    return new (this, DOMMemoryManager::DOCUMENT_FRAGMENT_OBJECT) DOMDocumentFragmentImpl(this);
 }
 
 
@@ -273,7 +282,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, nam, false);
+    return new (this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, nam, false);
 }
 
 
@@ -287,7 +296,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, qualifiedName, publicId, systemId, false);
+    return new (this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(this, qualifiedName, publicId, systemId, false);
 }
 
 
@@ -297,13 +306,13 @@
     if(!tagName || !isXMLName(tagName))
         throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::ELEMENT_OBJECT) DOMElementImpl(this,tagName);
+    return new (this, DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(this,tagName);
 }
 
 
 DOMElement *DOMDocumentImpl::createElementNoCheck(const XMLCh *tagName)
 {
-    return new (this, DOMDocumentImpl::ELEMENT_OBJECT) DOMElementImpl(this, tagName);
+    return new (this, DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(this, tagName);
 }
 
 
@@ -315,7 +324,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::ENTITY_OBJECT) DOMEntityImpl(this, nam);
+    return new (this, DOMMemoryManager::ENTITY_OBJECT) DOMEntityImpl(this, nam);
 }
 
 
@@ -326,7 +335,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam);
+    return new (this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam);
 }
 
 DOMEntityReference *DOMDocumentImpl::createEntityReferenceByParser(const XMLCh *nam)
@@ -335,7 +344,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam, false);
+    return new (this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(this, nam, false);
 }
 
 DOMNotation *DOMDocumentImpl::createNotation(const XMLCh *nam)
@@ -344,7 +353,7 @@
         throw DOMException(
         DOMException::INVALID_CHARACTER_ERR, 0, getMemoryManager());
 
-    return new (this, DOMDocumentImpl::NOTATION_OBJECT) DOMNotationImpl(this, nam);
+    return new (this, DOMMemoryManager::NOTATION_OBJECT) DOMNotationImpl(this, nam);
 }
 
 
@@ -354,7 +363,7 @@
 {
     if(!target || !isXMLName(target))
         throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager());
-    return new (this, DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(this,target,data);
+    return new (this, DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(this,target,data);
 }
 
 
@@ -362,7 +371,7 @@
 
 DOMText *DOMDocumentImpl::createTextNode(const XMLCh *data)
 {
-    return new (this, DOMDocumentImpl::TEXT_OBJECT) DOMTextImpl(this,data);
+    return new (this, DOMMemoryManager::TEXT_OBJECT) DOMTextImpl(this,data);
 }
 
 
@@ -570,7 +579,7 @@
     if(!qualifiedName || !isXMLName(qualifiedName))
         throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager());
     //XMLCh * pooledTagName = this->fNamePool->getPooledString(qualifiedName);
-    return new (this, DOMDocumentImpl::ELEMENT_NS_OBJECT) DOMElementNSImpl(this, fNamespaceURI, qualifiedName);
+    return new (this, DOMMemoryManager::ELEMENT_NS_OBJECT) DOMElementNSImpl(this, fNamespaceURI, qualifiedName);
 }
 
 DOMElement *DOMDocumentImpl::createElementNS(const XMLCh *fNamespaceURI,
@@ -590,7 +599,7 @@
 {
     if(!qualifiedName || !isXMLName(qualifiedName))
         throw DOMException(DOMException::INVALID_CHARACTER_ERR,0, getMemoryManager());
-    return new (this, DOMDocumentImpl::ATTR_NS_OBJECT) DOMAttrNSImpl(this, fNamespaceURI, qualifiedName);
+    return new (this, DOMMemoryManager::ATTR_NS_OBJECT) DOMAttrNSImpl(this, fNamespaceURI, qualifiedName);
 }
 
 
@@ -747,8 +756,6 @@
            DOMNode*         DOMDocumentImpl::getPreviousSibling() const              {return fNode.getPreviousSibling (); }
            bool             DOMDocumentImpl::hasChildNodes() const                   {return fParent.hasChildNodes (); }
            void             DOMDocumentImpl::normalize()                             {fParent.normalize (); }
-           bool             DOMDocumentImpl::isSupported(const XMLCh *feature, const XMLCh *version) const
-                                                                                     {return fNode.isSupported (feature, version); }
            void             DOMDocumentImpl::setPrefix(const XMLCh  *prefix)         {fNode.setPrefix(prefix); }
            bool             DOMDocumentImpl::hasAttributes() const                   {return fNode.hasAttributes(); }
            bool             DOMDocumentImpl::isSameNode(const DOMNode* other) const  {return fNode.isSameNode(other);}
@@ -762,7 +769,6 @@
            const XMLCh*     DOMDocumentImpl::lookupPrefix(const XMLCh* namespaceURI) const  {return fNode.lookupPrefix(namespaceURI); }
            bool             DOMDocumentImpl::isDefaultNamespace(const XMLCh* namespaceURI) const {return fNode.isDefaultNamespace(namespaceURI); }
            const XMLCh*     DOMDocumentImpl::lookupNamespaceURI(const XMLCh* prefix) const  {return fNode.lookupNamespaceURI(prefix); }
-           void*            DOMDocumentImpl::getFeature(const XMLCh* feature, const XMLCh* version) const {return fNode.getFeature(feature, version); }
 
 
 
@@ -794,14 +800,19 @@
     else return this->fNamePool->getPooledString(src);
 }
 
-static const int kHeapAllocSize = 0x10000;    // The chunk size to allocate from the
-                                              //   system allocator.
+XMLSize_t DOMDocumentImpl::getMemoryAllocationBlockSize() const
+{
+    return fHeapAllocSize;
+}
 
-static const size_t kMaxSubAllocationSize = 4096;  // Any request for more bytes
-                                                   //  than this will be handled by
-                                                   //  allocating directly with system.
+void DOMDocumentImpl::setMemoryAllocationBlockSize(XMLSize_t size)
+{
+    // the new size must be bigger than the maximum amount of each allocation
+    if(size>kMaxSubAllocationSize)
+        fHeapAllocSize=size;
+}
 
-void *         DOMDocumentImpl::allocate(size_t amount)
+void *         DOMDocumentImpl::allocate(XMLSize_t amount)
 {	
 	//	Align the request size so that suballocated blocks
 	//	beyond this one will be maintained at the same alignment.
@@ -849,12 +860,15 @@
 
         // Get a new block from the system allocator.
         void* newBlock;
-        newBlock = fMemoryManager->allocate(kHeapAllocSize * sizeof(char)); //new char[kHeapAllocSize];
+        newBlock = fMemoryManager->allocate(fHeapAllocSize * sizeof(char)); //new char[kHeapAllocSize];
         
         *(void **)newBlock = fCurrentBlock;
         fCurrentBlock = newBlock;
         fFreePtr = (char *)newBlock + sizeOfHeader;
-        fFreeBytesRemaining = kHeapAllocSize - sizeOfHeader;
+        fFreeBytesRemaining = fHeapAllocSize - sizeOfHeader;
+
+        if(fHeapAllocSize<kMaxHeapAllocSize)
+            fHeapAllocSize*=2;
     }
 
 	//	Subdivide the request off current block
@@ -1381,7 +1395,7 @@
     castToNodeImpl(object)->callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
 }
 
-void DOMDocumentImpl::release(DOMNode* object, NodeObjectType type)
+void DOMDocumentImpl::release(DOMNode* object, DOMMemoryManager::NodeObjectType type)
 {
     if (!fRecycleNodePtr)
         fRecycleNodePtr = new (fMemoryManager) RefArrayOf<DOMNodePtr> (15, fMemoryManager);
@@ -1409,7 +1423,7 @@
 }
 
 
-void * DOMDocumentImpl::allocate(size_t amount, NodeObjectType type)
+void * DOMDocumentImpl::allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type)
 {
     if (!fRecycleNodePtr)
         return allocate(amount);
@@ -1421,5 +1435,21 @@
     return (void*) ptr->pop();
 
 }
+
+bool DOMDocumentImpl::isSupported(const XMLCh *feature, const XMLCh *version) const
+{
+    // check for '+DOMMemoryManager'
+    if(feature && *feature=='+' && XMLString::equals(feature+1, XMLUni::fgXercescInterfaceDOMMemoryManager))
+        return true;
+    return fNode.isSupported (feature, version);
+}
+
+void* DOMDocumentImpl::getFeature(const XMLCh* feature, const XMLCh* version) const
+{
+    if(XMLString::equals(feature, XMLUni::fgXercescInterfaceDOMMemoryManager))
+        return (DOMMemoryManager*)this;
+    return fNode.getFeature(feature,version);
+}
+
 
 XERCES_CPP_NAMESPACE_END

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.hpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentImpl.hpp Tue Dec 20 05:18:29 2005
@@ -37,6 +37,7 @@
 #include <xercesc/util/KeyRefPair.hpp>
 #include <xercesc/dom/DOMDocument.hpp>
 #include <xercesc/dom/DOMUserDataHandler.hpp>
+#include <xercesc/dom/DOMMemoryManager.hpp>
 #include "DOMNodeImpl.hpp"
 #include "DOMParentNode.hpp"
 #include "DOMDeepNodeListPool.hpp"
@@ -76,27 +77,8 @@
 typedef KeyRefPair<void, DOMUserDataHandler> DOMUserDataRecord;
 typedef RefStackOf<DOMNode>               DOMNodePtr;
 
-class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMDocument {
+class CDOM_EXPORT DOMDocumentImpl: public XMemory, public DOMMemoryManager, public DOMDocument {
 public:
-    // -----------------------------------------------------------------------
-    //  data types
-    // -----------------------------------------------------------------------
-    enum NodeObjectType {
-        ATTR_OBJECT                   = 0,
-        ATTR_NS_OBJECT                = 1,
-        CDATA_SECTION_OBJECT          = 2,
-        COMMENT_OBJECT                = 3,
-        DOCUMENT_FRAGMENT_OBJECT      = 4,
-        DOCUMENT_TYPE_OBJECT          = 5,
-        ELEMENT_OBJECT                = 6,
-        ELEMENT_NS_OBJECT             = 7,
-        ENTITY_OBJECT                 = 8,
-        ENTITY_REFERENCE_OBJECT       = 9,
-        NOTATION_OBJECT               = 10,
-        PROCESSING_INSTRUCTION_OBJECT = 11,
-        TEXT_OBJECT                   = 12
-    };
-
 
     // -----------------------------------------------------------------------
     //  data
@@ -115,10 +97,10 @@
 
     void                         setDocumentType(DOMDocumentType *doctype);
 
-    // Add all functions that are pure virutal in DOMNODE
+    // Add all functions that are pure virtual in DOMNODE
     DOMNODE_FUNCTIONS;
 
-    // Add all functions that are pure virutal in DOMDocument
+    // Add all functions that are pure virtual in DOMDocument
     virtual DOMAttr*             createAttribute(const XMLCh *name);
     virtual DOMCDATASection*     createCDATASection(const XMLCh *data);
     virtual DOMComment*          createComment(const XMLCh *data);
@@ -164,6 +146,13 @@
     // Extension to be called by the Parser
     DOMEntityReference*  createEntityReferenceByParser(const XMLCh * name);
 
+    // Add all functions that are pure virtual in DOMMemoryManager
+    virtual XMLSize_t getMemoryAllocationBlockSize() const;
+    virtual void setMemoryAllocationBlockSize(XMLSize_t size);
+    virtual void* allocate(XMLSize_t amount);
+    virtual void* allocate(XMLSize_t amount, DOMMemoryManager::NodeObjectType type);
+    virtual void release(DOMNode* object, DOMMemoryManager::NodeObjectType type);
+    virtual XMLCh* cloneString(const XMLCh *src);
 
     //
     // Functions to keep track of document mutations, so that node list chached
@@ -262,12 +251,8 @@
     //                               a document, and is not recovered until the
     //                               document itself is deleted.
     //
-    void*                        allocate(size_t amount);
-    void*                        allocate(size_t amount, NodeObjectType type);
-    XMLCh*                       cloneString(const XMLCh *src);
     const XMLCh*                 getPooledString(const XMLCh *src);
     void                         deleteHeap();
-    void                         release(DOMNode* object, NodeObjectType type);
     void                         releaseDocNotifyUserData(DOMNode* object);
     void                         releaseBuffer(DOMBuffer* buffer);
     DOMBuffer*                   popBuffer();
@@ -326,7 +311,8 @@
     //
     void*                 fCurrentBlock;
     char*                 fFreePtr;
-    XMLSize_t             fFreeBytesRemaining;
+    XMLSize_t             fFreeBytesRemaining,
+                          fHeapAllocSize;
 
     // To recycle the DOMNode pointer
     RefArrayOf<DOMNodePtr>* fRecycleNodePtr;
@@ -364,17 +350,27 @@
 //                 the heap owned by a document.
 //
 // ---------------------------------------------------------------------------
-inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl::NodeObjectType type)
+inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType type)
 {
-    // revist.  Probably should be a checked cast.
-    void *p = ((XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *)doc)->allocate(amt, type);
+    XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
+    if(!mgr)
+    {
+        assert(0);
+        return 0;
+    }
+    void *p = mgr->allocate(amt, type);
     return p;
 }
 
 inline void * operator new(size_t amt, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
 {
-    // revist.  Probably should be a checked cast.
-    void *p = ((XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl *)doc)->allocate(amt);
+    XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager* mgr=(XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager*)doc->getFeature(XERCES_CPP_NAMESPACE_QUALIFIER XMLUni::fgXercescInterfaceDOMMemoryManager,0);
+    if(!mgr)
+    {
+        assert(0);
+        return 0;
+    }
+    void *p = mgr->allocate(amt);
     return p;
 }
 
@@ -388,7 +384,7 @@
 {
     return;
 }
-inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocumentImpl::NodeObjectType /*type*/)
+inline void operator delete(void* /*ptr*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * /*doc*/, XERCES_CPP_NAMESPACE_QUALIFIER DOMMemoryManager::NodeObjectType /*type*/)
 {
     return;
 }

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp Tue Dec 20 05:18:29 2005
@@ -215,9 +215,9 @@
 {
     DOMNode* newNode = 0;
     if (castToNodeImpl(this)->getOwnerDocument())
-        newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
+        newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
     else
-        newNode = new (&gDocTypeDocument(), DOMDocumentImpl::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
+        newNode = new (&gDocTypeDocument(), DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
 
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
@@ -389,7 +389,7 @@
             DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
             if (doc) {
                 fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
-                doc->release(this, DOMDocumentImpl::DOCUMENT_TYPE_OBJECT);
+                doc->release(this, DOMMemoryManager::DOCUMENT_TYPE_OBJECT);
             }
             else {
                 // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMElementImpl.cpp Tue Dec 20 05:18:29 2005
@@ -104,7 +104,7 @@
 
 DOMNode *DOMElementImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ELEMENT_OBJECT) DOMElementImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::ELEMENT_OBJECT) DOMElementImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -475,7 +475,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ELEMENT_OBJECT);
+        doc->release(this, DOMMemoryManager::ELEMENT_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMElementNSImpl.cpp Tue Dec 20 05:18:29 2005
@@ -58,7 +58,7 @@
 }
 
 DOMNode * DOMElementNSImpl::cloneNode(bool deep) const {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ELEMENT_NS_OBJECT) DOMElementNSImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::ELEMENT_NS_OBJECT) DOMElementNSImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -181,7 +181,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ELEMENT_NS_OBJECT);
+        doc->release(this, DOMMemoryManager::ELEMENT_NS_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMEntityImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMEntityImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMEntityImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMEntityImpl.cpp Tue Dec 20 05:18:29 2005
@@ -71,7 +71,7 @@
 
 DOMNode *DOMEntityImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ENTITY_OBJECT) DOMEntityImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::ENTITY_OBJECT) DOMEntityImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -217,7 +217,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ENTITY_OBJECT);
+        doc->release(this, DOMMemoryManager::ENTITY_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMEntityReferenceImpl.cpp Tue Dec 20 05:18:29 2005
@@ -109,7 +109,7 @@
 
 DOMNode *DOMEntityReferenceImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::ENTITY_REFERENCE_OBJECT) DOMEntityReferenceImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -162,7 +162,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fParent.release();
-        doc->release(this, DOMDocumentImpl::ENTITY_REFERENCE_OBJECT);
+        doc->release(this, DOMMemoryManager::ENTITY_REFERENCE_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMNotationImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMNotationImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMNotationImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMNotationImpl.cpp Tue Dec 20 05:18:29 2005
@@ -51,7 +51,7 @@
 
 DOMNode *DOMNotationImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::NOTATION_OBJECT) DOMNotationImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::NOTATION_OBJECT) DOMNotationImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -113,7 +113,7 @@
     DOMDocumentImpl* doc = (DOMDocumentImpl*) getOwnerDocument();
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
-        doc->release(this, DOMDocumentImpl::NOTATION_OBJECT);
+        doc->release(this, DOMMemoryManager::NOTATION_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMProcessingInstructionImpl.cpp Tue Dec 20 05:18:29 2005
@@ -60,7 +60,7 @@
 
 DOMNode *DOMProcessingInstructionImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT) DOMProcessingInstructionImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -102,7 +102,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fCharacterData.releaseBuffer();
-        doc->release(this, DOMDocumentImpl::PROCESSING_INSTRUCTION_OBJECT);
+        doc->release(this, DOMMemoryManager::PROCESSING_INSTRUCTION_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMTextImpl.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/dom/impl/DOMTextImpl.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMTextImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMTextImpl.cpp Tue Dec 20 05:18:29 2005
@@ -59,7 +59,7 @@
 
 DOMNode *DOMTextImpl::cloneNode(bool deep) const
 {
-    DOMNode* newNode = new (getOwnerDocument(), DOMDocumentImpl::TEXT_OBJECT) DOMTextImpl(*this, deep);
+    DOMNode* newNode = new (getOwnerDocument(), DOMMemoryManager::TEXT_OBJECT) DOMTextImpl(*this, deep);
     fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
     return newNode;
 }
@@ -150,7 +150,7 @@
     if (doc) {
         fNode.callUserDataHandlers(DOMUserDataHandler::NODE_DELETED, 0, 0);
         fCharacterData.releaseBuffer();
-        doc->release(this, DOMDocumentImpl::TEXT_OBJECT);
+        doc->release(this, DOMMemoryManager::TEXT_OBJECT);
     }
     else {
         // shouldn't reach here

Modified: xerces/c/trunk/src/xercesc/util/XMLUni.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/util/XMLUni.cpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUni.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUni.cpp Tue Dec 20 05:18:29 2005
@@ -1634,6 +1634,13 @@
     chLatin_e, chLatin_I, chLatin_m, chLatin_p, chLatin_l, chNull
 };
 
+const XMLCh XMLUni::fgXercescInterfaceDOMMemoryManager[] =
+{
+    chLatin_D, chLatin_O, chLatin_M, chLatin_M, chLatin_e, chLatin_m, chLatin_o,
+    chLatin_r, chLatin_y, chLatin_M, chLatin_a, chLatin_n, chLatin_a, chLatin_g, 
+    chLatin_e, chLatin_r, chNull
+};
+
 // en_US
 const char XMLUni::fgXercescDefaultLocale[] = "en_US";
 

Modified: xerces/c/trunk/src/xercesc/util/XMLUni.hpp
URL: http://svn.apache.org/viewcvs/xerces/c/trunk/src/xercesc/util/XMLUni.hpp?rev=357986&r1=357985&r2=357986&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/XMLUni.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/XMLUni.hpp Tue Dec 20 05:18:29 2005
@@ -281,6 +281,7 @@
     // Private interface names
     static const XMLCh fgXercescInterfacePSVITypeInfo[];
     static const XMLCh fgXercescInterfaceDOMDocumentTypeImpl[];
+    static const XMLCh fgXercescInterfaceDOMMemoryManager[];
 
     // Locale
     static const char  fgXercescDefaultLocale[];



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org