You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dm...@apache.org on 2004/11/08 19:13:58 UTC
cvs commit: xml-xalan/c/src/xalanc/XercesParserLiaison FormatterToXercesDOM.cpp FormatterToXercesDOM.hpp XercesAttrWrapperAllocator.cpp XercesAttrWrapperAllocator.hpp XercesCDATASectionWrapper.cpp XercesCDATASectionWrapper.hpp XercesCommentWrapper.cpp XercesCommentWrapper.hpp XercesDocumentTypeWrapper.cpp XercesDocumentTypeWrapper.hpp XercesDocumentWrapper.cpp XercesDocumentWrapper.hpp XercesDOMFormatterWalker.hpp XercesDOMImplementationWrapper.cpp XercesDOMImplementationWrapper.hpp XercesDOMSupport.cpp XercesDOMSupport.hpp XercesElementWrapperAllocator.cpp XercesElementWrapperAllocator.hpp XercesEntityReferenceWrapper.cpp XercesEntityReferenceWrapper.hpp XercesEntityWrapper.cpp XercesEntityWrapper.hpp XercesLiaisonXalanDOMStringPool.cpp XercesLiaisonXalanDOMStringPool.hpp XercesNamedNodeMapAttributeList.cpp XercesNamedNodeMapAttributeList.hpp XercesNotationWrapper.cpp XercesNotationWrapper.hpp XercesParserLiaison.cpp XercesParserLiaison.hpp XercesProcessingInstructionWrapper.cpp XercesProcessingInstructionWrapper.hpp XercesTextWrapper.cpp XercesTextWrapper.hpp XercesTextWrapperAllocator.cpp XercesTextWrapperAllocator.hpp XercesWrapperHelper.cpp XercesWrapperHelper.hpp XercesWrapperNavigator.cpp XercesWrapperNavigatorAllocator.cpp XercesWrapperNavigatorAllocator.hpp XercesWrapperToXalanNodeMap.cpp XercesWrapperToXalanNodeMap.hpp
dmitryh 2004/11/08 10:13:58
Modified: c/src/xalanc/XercesParserLiaison FormatterToXercesDOM.cpp
FormatterToXercesDOM.hpp
XercesAttrWrapperAllocator.cpp
XercesAttrWrapperAllocator.hpp
XercesCDATASectionWrapper.cpp
XercesCDATASectionWrapper.hpp
XercesCommentWrapper.cpp XercesCommentWrapper.hpp
XercesDocumentTypeWrapper.cpp
XercesDocumentTypeWrapper.hpp
XercesDocumentWrapper.cpp XercesDocumentWrapper.hpp
XercesDOMFormatterWalker.hpp
XercesDOMImplementationWrapper.cpp
XercesDOMImplementationWrapper.hpp
XercesDOMSupport.cpp XercesDOMSupport.hpp
XercesElementWrapperAllocator.cpp
XercesElementWrapperAllocator.hpp
XercesEntityReferenceWrapper.cpp
XercesEntityReferenceWrapper.hpp
XercesEntityWrapper.cpp XercesEntityWrapper.hpp
XercesLiaisonXalanDOMStringPool.cpp
XercesLiaisonXalanDOMStringPool.hpp
XercesNamedNodeMapAttributeList.cpp
XercesNamedNodeMapAttributeList.hpp
XercesNotationWrapper.cpp XercesNotationWrapper.hpp
XercesParserLiaison.cpp XercesParserLiaison.hpp
XercesProcessingInstructionWrapper.cpp
XercesProcessingInstructionWrapper.hpp
XercesTextWrapper.cpp XercesTextWrapper.hpp
XercesTextWrapperAllocator.cpp
XercesTextWrapperAllocator.hpp
XercesWrapperHelper.cpp XercesWrapperHelper.hpp
XercesWrapperNavigator.cpp
XercesWrapperNavigatorAllocator.cpp
XercesWrapperNavigatorAllocator.hpp
XercesWrapperToXalanNodeMap.cpp
XercesWrapperToXalanNodeMap.hpp
Log:
Initial implementation on the pluggable memory management
Revision Changes Path
1.5 +9 -7 xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp
Index: FormatterToXercesDOM.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FormatterToXercesDOM.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ FormatterToXercesDOM.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -58,11 +58,12 @@
-const XalanDOMString FormatterToXercesDOM::s_emptyString;
+const XalanDOMString FormatterToXercesDOM::s_emptyString(XalanMemMgrs::getDummyMemMgr());
FormatterToXercesDOM::FormatterToXercesDOM(
+ MemoryManagerType& theManager,
DOMDocument_Type* doc,
DOMDocumentFragmentType* docFrag,
DOMElementType* currentElement) :
@@ -70,9 +71,9 @@
m_doc(doc),
m_docFrag(docFrag),
m_currentElem(currentElement),
- m_elemStack(),
- m_buffer(),
- m_textBuffer()
+ m_elemStack(theManager),
+ m_buffer(theManager),
+ m_textBuffer(theManager)
{
assert(m_doc != 0 && m_docFrag != 0);
}
@@ -80,15 +81,16 @@
FormatterToXercesDOM::FormatterToXercesDOM(
+ MemoryManagerType& theManager,
DOMDocument_Type* doc,
DOMElementType* elem) :
FormatterListener(OUTPUT_METHOD_DOM),
m_doc(doc),
m_docFrag(0),
m_currentElem(elem),
- m_elemStack(),
- m_buffer(),
- m_textBuffer()
+ m_elemStack(theManager),
+ m_buffer(theManager),
+ m_textBuffer(theManager)
{
assert(m_doc != 0);
}
1.7 +2 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp
Index: FormatterToXercesDOM.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FormatterToXercesDOM.hpp 31 Jul 2004 06:05:11 -0000 1.6
+++ FormatterToXercesDOM.hpp 8 Nov 2004 18:13:57 -0000 1.7
@@ -61,6 +61,7 @@
* @param currentElement current element for nodes
*/
FormatterToXercesDOM(
+ MemoryManagerType& theManager,
DOMDocument_Type* doc,
DOMDocumentFragmentType* docFrag,
DOMElementType* currentElement);
@@ -73,6 +74,7 @@
* @param elem current element for nodes
*/
FormatterToXercesDOM(
+ MemoryManagerType& theManager,
DOMDocument_Type* doc,
DOMElementType* currentElement);
1.5 +2 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesAttrWrapperAllocator.cpp
Index: XercesAttrWrapperAllocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesAttrWrapperAllocator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesAttrWrapperAllocator.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesAttrWrapperAllocator.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -23,8 +23,8 @@
-XercesAttrWrapperAllocator::XercesAttrWrapperAllocator(size_type theBlockCount) :
- m_allocator(theBlockCount)
+XercesAttrWrapperAllocator::XercesAttrWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount) :
+ m_allocator(theManager, theBlockCount)
{
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesAttrWrapperAllocator.hpp
Index: XercesAttrWrapperAllocator.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesAttrWrapperAllocator.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesAttrWrapperAllocator.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesAttrWrapperAllocator.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -57,7 +57,7 @@
*
* @param theBlockSize The block size.
*/
- XercesAttrWrapperAllocator(size_type theBlockCount);
+ XercesAttrWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount);
~XercesAttrWrapperAllocator();
1.5 +23 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp
Index: XercesCDATASectionWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesCDATASectionWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesCDATASectionWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -50,7 +50,24 @@
assert(theXercesCDATASection != 0);
}
+XercesCDATASectionWrapper*
+XercesCDATASectionWrapper::create( MemoryManagerType& theManager,
+ const DOMCDATASectionType* theXercesCDATASection,
+ const XercesWrapperNavigator& theNavigator)
+
+{
+ typedef XercesCDATASectionWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+ new (theResult) ThisType(theXercesCDATASection, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesCDATASectionWrapper::~XercesCDATASectionWrapper()
{
@@ -302,12 +319,15 @@
-XalanDOMString
+XalanDOMString&
XercesCDATASectionWrapper::substringData(
unsigned int offset,
- unsigned int count) const
+ unsigned int count,
+ XalanDOMString& theResult) const
{
- return XercesWrapperHelper::substringData(m_xercesNode, offset, count);
+ XercesWrapperHelper::substringData(m_xercesNode, offset, count, theResult);
+
+ return theResult;
}
1.6 +10 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.hpp
Index: XercesCDATASectionWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCDATASectionWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesCDATASectionWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesCDATASectionWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -21,6 +21,8 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
#include <xalanc/XalanDOM/XalanCDATASection.hpp>
@@ -46,6 +48,11 @@
const DOMCDATASectionType* theXercesCDATASection,
const XercesWrapperNavigator& theNavigator);
+ static XercesCDATASectionWrapper*
+ create( MemoryManagerType& theManager,
+ const DOMCDATASectionType* theXercesCDATASection,
+ const XercesWrapperNavigator& theNavigator);
+
virtual
~XercesCDATASectionWrapper();
@@ -441,10 +448,11 @@
* <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does not
* fit into a <code>DOMString</code>.
*/
- virtual XalanDOMString
+ virtual XalanDOMString&
substringData(
unsigned int offset,
- unsigned int count) const;
+ unsigned int count,
+ XalanDOMString& theResult) const;
//@}
/** @name Functions that set or change data. */
1.5 +23 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp
Index: XercesCommentWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCommentWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesCommentWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesCommentWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -46,7 +46,24 @@
assert(theXercesComment != 0);
}
+XercesCommentWrapper*
+XercesCommentWrapper::create( MemoryManagerType& theManager,
+ const DOMCommentType* theXercesComment,
+ const XercesWrapperNavigator& theNavigator)
+
+{
+ typedef XercesCommentWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+ new (theResult) ThisType(theXercesComment, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesCommentWrapper::~XercesCommentWrapper()
{
@@ -298,12 +315,15 @@
-XalanDOMString
+XalanDOMString&
XercesCommentWrapper::substringData(
unsigned int offset,
- unsigned int count) const
+ unsigned int count,
+ XalanDOMString& theResult) const
{
- return XercesWrapperHelper::substringData(m_xercesNode, offset, count);
+ XercesWrapperHelper::substringData(m_xercesNode, offset, count, theResult);
+
+ return theResult;
}
1.6 +9 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCommentWrapper.hpp
Index: XercesCommentWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesCommentWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesCommentWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesCommentWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -20,7 +20,7 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
-
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
#include <xalanc/XalanDOM/XalanComment.hpp>
#include <xalanc/XercesParserLiaison/XercesWrapperTypes.hpp>
@@ -43,6 +43,11 @@
const DOMCommentType* theXercesComment,
const XercesWrapperNavigator& theNavigator);
+ static XercesCommentWrapper*
+ create( MemoryManagerType& theManager,
+ const DOMCommentType* theXercesComment,
+ const XercesWrapperNavigator& theNavigator);
+
virtual
~XercesCommentWrapper();
@@ -437,10 +442,11 @@
* <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does not
* fit into a <code>DOMString</code>.
*/
- virtual XalanDOMString
+ virtual XalanDOMString&
substringData(
unsigned int offset,
- unsigned int count) const;
+ unsigned int count,
+ XalanDOMString& theResult) const;
//@}
/** @name Functions that set or change data. */
1.5 +16 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp
Index: XercesDocumentTypeWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDocumentTypeWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesDocumentTypeWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -50,7 +50,23 @@
assert(theXercesDOMDocumentType != 0);
}
+XercesDocumentTypeWrapper*
+XercesDocumentTypeWrapper::create( MemoryManagerType& theManager,
+ const DOMDocumentType_Type* theXercesDOMDocumentType,
+ const XercesWrapperNavigator& theNavigator)
+{
+ typedef XercesDocumentTypeWrapper ThisType;
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMDocumentType, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesDocumentTypeWrapper::~XercesDocumentTypeWrapper()
{
1.6 +6 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.hpp
Index: XercesDocumentTypeWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentTypeWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesDocumentTypeWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesDocumentTypeWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -24,7 +24,7 @@
#include <xalanc/XalanDOM/XalanDocumentType.hpp>
-
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
#include <xalanc/XercesParserLiaison/XercesNamedNodeMapWrapper.hpp>
#include <xalanc/XercesParserLiaison/XercesWrapperTypes.hpp>
@@ -47,6 +47,11 @@
XercesDocumentTypeWrapper(
const DOMDocumentType_Type* theXercesDOMDocumentType,
const XercesWrapperNavigator& theNavigator);
+
+ static XercesDocumentTypeWrapper*
+ create( MemoryManagerType& theManager,
+ const DOMDocumentType_Type* theXercesDOMDocumentType,
+ const XercesWrapperNavigator& theNavigator);
virtual
~XercesDocumentTypeWrapper();
1.8 +66 -20 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp
Index: XercesDocumentWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XercesDocumentWrapper.cpp 12 Aug 2004 21:37:56 -0000 1.7
+++ XercesDocumentWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.8
@@ -73,6 +73,7 @@
XercesDocumentWrapper::XercesDocumentWrapper(
+ MemoryManagerType& theManager,
const DOMDocument_Type* theXercesDocument,
bool threadSafe,
bool buildWrapper,
@@ -80,21 +81,21 @@
XalanDocument(),
m_xercesDocument(theXercesDocument),
m_documentElement(0),
- m_nodeMap(),
- m_domImplementation(new XercesDOMImplementationWrapper(theXercesDocument->getImplementation())),
- m_navigatorAllocator(25),
+ m_nodeMap(theManager),
+ m_domImplementation(theManager, XercesDOMImplementationWrapper::create(theManager, theXercesDocument->getImplementation())),
+ m_navigatorAllocator(theManager, 25),
m_navigator(0),
m_children(theXercesDocument->getChildNodes(),
*m_navigator),
- m_nodes(),
+ m_nodes(theManager),
m_doctype(0),
m_mappingMode(threadSafe == true ? false : !buildWrapper),
m_indexValid(false),
m_buildMaps(m_mappingMode == true ? true : buildMaps),
- m_elementAllocator(25),
- m_textAllocator(25),
- m_attributeAllocator(25),
- m_stringPool(threadSafe == true ? new XercesLiaisonXalanDOMStringPool : new XalanDOMStringPool)
+ m_elementAllocator(theManager, 25),
+ m_textAllocator(theManager, 25),
+ m_attributeAllocator(theManager, 25),
+ m_stringPool(theManager, threadSafe == true ? XercesLiaisonXalanDOMStringPool::create(theManager) : XalanDOMStringPool::create(theManager))
{
assert(theXercesDocument != 0);
@@ -115,7 +116,30 @@
}
}
+XercesDocumentWrapper*
+XercesDocumentWrapper::create(
+ MemoryManagerType& theManager,
+ const DOMDocument_Type* theXercesDocument,
+ bool threadSafe,
+ bool buildWrapper,
+ bool buildMaps)
+{
+ typedef XercesDocumentWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+ new (theResult) ThisType(theManager,
+ theXercesDocument,
+ threadSafe,
+ buildWrapper,
+ buildMaps);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesDocumentWrapper::~XercesDocumentWrapper()
{
@@ -317,7 +341,7 @@
for_each(
m_nodes.begin(),
m_nodes.end(),
- DeleteFunctor<XalanNode>());
+ DeleteFunctor<XalanNode>(m_nodes.getMemoryManager()));
// Clear everything out, since we just delete everything...
m_nodes.clear();
@@ -391,7 +415,7 @@
#endif
// Update the member variable for the new instance.
- This->m_doctype = new XercesDocumentTypeWrapper(theDoctype, theNavigator);
+ This->m_doctype = XercesDocumentTypeWrapper::create( getMemoryManager(), theDoctype, theNavigator);
if (mapNode == true)
{
@@ -494,7 +518,7 @@
XercesCommentWrapper*
XercesDocumentWrapper::createWrapperNode(
const DOMCommentType* theXercesNode,
- IndexType theIndex,
+ IndexType theIndex,
bool mapNode,
XercesWrapperNavigator** theWrapperNodeNavigator) const
{
@@ -504,7 +528,9 @@
theNavigator.setIndex(theIndex);
XercesCommentWrapper* const theWrapper =
- new XercesCommentWrapper(theXercesNode,
+ XercesCommentWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -546,7 +572,9 @@
theNavigator.setIndex(theIndex);
XercesCDATASectionWrapper* const theWrapper =
- new XercesCDATASectionWrapper(theXercesNode,
+ XercesCDATASectionWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -588,7 +616,9 @@
theNavigator.setIndex(theIndex);
XercesProcessingInstructionWrapper* const theWrapper =
- new XercesProcessingInstructionWrapper(theXercesNode,
+ XercesProcessingInstructionWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -668,7 +698,9 @@
theNavigator.setIndex(theIndex);
XercesEntityWrapper* const theWrapper =
- new XercesEntityWrapper(theXercesNode,
+ XercesEntityWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -708,7 +740,9 @@
theNavigator.setIndex(theIndex);
XercesEntityReferenceWrapper* const theWrapper =
- new XercesEntityReferenceWrapper(theXercesNode,
+ XercesEntityReferenceWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -750,7 +784,9 @@
theNavigator.setIndex(theIndex);
XercesNotationWrapper* const theWrapper =
- new XercesNotationWrapper(theXercesNode,
+ XercesNotationWrapper::create(
+ getMemoryManager(),
+ theXercesNode,
theNavigator);
#if defined(XALAN_NO_MUTABLE)
@@ -962,7 +998,17 @@
else
{
// Delete the node...
- delete *i;
+ XalanNode* ptrToDelete = *i;
+
+ if ( ptrToDelete != 0 )
+ {
+ MemoryManagerType& theManager = m_nodes.getMemoryManager();
+
+ ptrToDelete->~XalanNode();
+
+ theManager.deallocate(ptrToDelete);
+
+ }
// Erase it from the map...
m_nodes.erase(i);
@@ -1460,8 +1506,8 @@
bool theBuildMapsFlag) :
m_document(theDocument),
m_currentIndex(theStartIndex),
- m_parentNavigatorStack(),
- m_siblingNavigatorStack(),
+ m_parentNavigatorStack(theDocument->getMemoryManager()),
+ m_siblingNavigatorStack(theDocument->getMemoryManager()),
m_buildMaps(theBuildMapsFlag)
{
assert(theDocument != 0 && theDocumentNavigator != 0);
1.7 +18 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp
Index: XercesDocumentWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDocumentWrapper.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XercesDocumentWrapper.hpp 12 Aug 2004 21:37:56 -0000 1.6
+++ XercesDocumentWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.7
@@ -37,7 +37,7 @@
-#include <xalanc/Include/XalanAutoPtr.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
@@ -96,11 +96,26 @@
*
*/
XercesDocumentWrapper(
+ MemoryManagerType& theManager,
const DOMDocument_Type* theXercesDocument,
bool threadSafe = true,
bool buildWrapper = true,
bool buildMaps = false);
+ static XercesDocumentWrapper*
+ create(
+ MemoryManagerType& theManager,
+ const DOMDocument_Type* theXercesDocument,
+ bool threadSafe,
+ bool buildWrapper,
+ bool buildMaps);
+
+ MemoryManagerType&
+ getMemoryManager() const
+ {
+ return m_nodeMap.getMemoryManager();
+ }
+
virtual
~XercesDocumentWrapper();
@@ -552,7 +567,7 @@
mutable XercesWrapperToXalanNodeMap m_nodeMap;
- XalanAutoPtr<XalanDOMImplementation> m_domImplementation;
+ XalanMemMgrAutoPtr<XalanDOMImplementation, true> m_domImplementation;
mutable XercesWrapperNavigatorAllocator m_navigatorAllocator;
@@ -578,7 +593,7 @@
mutable XercesAttrWrapperAllocator m_attributeAllocator;
- const XalanAutoPtr<XalanDOMStringPool> m_stringPool;
+ const XalanMemMgrAutoPtr<XalanDOMStringPool,true> m_stringPool;
};
1.5 +4 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMFormatterWalker.hpp
Index: XercesDOMFormatterWalker.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMFormatterWalker.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMFormatterWalker.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesDOMFormatterWalker.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -19,6 +19,9 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+
+#include <xalanc/Include/XalanMemoryManagement.hpp>
+
#include <xalanc/XercesParserLiaison/XercesDOMWalker.hpp>
@@ -61,6 +64,7 @@
private:
FormatterListener& m_formatterListener;
+
};
1.5 +15 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp
Index: XercesDOMImplementationWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMImplementationWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesDOMImplementationWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -54,6 +54,21 @@
{
}
+XercesDOMImplementationWrapper*
+XercesDOMImplementationWrapper::create(MemoryManagerType& theManager, DOMImplementationType* theXercesDOMImplementation)
+{
+ typedef XercesDOMImplementationWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMImplementation);
+
+ theGuard.release();
+
+ return theResult;
+}
bool
1.6 +4 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.hpp
Index: XercesDOMImplementationWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMImplementationWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesDOMImplementationWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesDOMImplementationWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -20,7 +20,7 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
-
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
#include <xalanc/XalanDOM/XalanDOMImplementation.hpp>
@@ -43,6 +43,9 @@
public:
XercesDOMImplementationWrapper(DOMImplementationType* theXercesDOMImplementation);
+
+ static XercesDOMImplementationWrapper*
+ create(MemoryManagerType& theManager, DOMImplementationType* theXercesDOMImplementation);
virtual
~XercesDOMImplementationWrapper();
1.5 +5 -4 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMSupport.cpp
Index: XercesDOMSupport.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMSupport.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMSupport.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesDOMSupport.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -36,9 +36,9 @@
-XercesDOMSupport::XercesDOMSupport() :
+XercesDOMSupport::XercesDOMSupport(MemoryManagerType& theManager) :
DOMSupport(),
- m_domSupportDefault()
+ m_domSupportDefault(theManager)
{
}
@@ -61,9 +61,10 @@
const XalanDOMString&
XercesDOMSupport::getUnparsedEntityURI(
const XalanDOMString& theName,
- const XalanDocument& theDocument) const
+ const XalanDocument& theDocument,
+ XalanDOMString& theURI) const
{
- return m_domSupportDefault.getUnparsedEntityURI(theName, theDocument);
+ return m_domSupportDefault.getUnparsedEntityURI(theName, theDocument, theURI);
}
1.5 +3 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMSupport.hpp
Index: XercesDOMSupport.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesDOMSupport.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesDOMSupport.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesDOMSupport.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -36,7 +36,7 @@
{
public:
- XercesDOMSupport();
+ XercesDOMSupport(MemoryManagerType& theManager);
virtual
~XercesDOMSupport();
@@ -51,7 +51,8 @@
virtual const XalanDOMString&
getUnparsedEntityURI(
const XalanDOMString& theName,
- const XalanDocument& theDocument) const;
+ const XalanDocument& theDocument,
+ XalanDOMString& theURI) const;
virtual bool
isNodeAfter(
1.5 +2 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesElementWrapperAllocator.cpp
Index: XercesElementWrapperAllocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesElementWrapperAllocator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesElementWrapperAllocator.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesElementWrapperAllocator.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -23,8 +23,8 @@
-XercesElementWrapperAllocator::XercesElementWrapperAllocator(size_type theBlockCount) :
- m_allocator(theBlockCount)
+XercesElementWrapperAllocator::XercesElementWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount) :
+ m_allocator(theManager, theBlockCount)
{
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesElementWrapperAllocator.hpp
Index: XercesElementWrapperAllocator.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesElementWrapperAllocator.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesElementWrapperAllocator.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesElementWrapperAllocator.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -58,7 +58,7 @@
*
* @param theBlockSize The block size.
*/
- XercesElementWrapperAllocator(size_type theBlockCount);
+ XercesElementWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount);
~XercesElementWrapperAllocator();
1.5 +18 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp
Index: XercesEntityReferenceWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesEntityReferenceWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesEntityReferenceWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -48,6 +48,24 @@
assert(theXercesDOMEntityReference != 0);
}
+XercesEntityReferenceWrapper*
+XercesEntityReferenceWrapper::create( MemoryManagerType& theManager,
+ const DOMEntityReferenceType* theXercesDOMEntityReference,
+ const XercesWrapperNavigator& theNavigator)
+
+{
+ typedef XercesEntityReferenceWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMEntityReference, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesEntityReferenceWrapper::~XercesEntityReferenceWrapper()
1.6 +7 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.hpp
Index: XercesEntityReferenceWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityReferenceWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesEntityReferenceWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesEntityReferenceWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -21,6 +21,8 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
#include <xalanc/XalanDOM/XalanEntityReference.hpp>
@@ -44,6 +46,11 @@
public:
XercesEntityReferenceWrapper(
+ const DOMEntityReferenceType* theXercesDOMEntityReference,
+ const XercesWrapperNavigator& theNavigator);
+
+ static XercesEntityReferenceWrapper*
+ create( MemoryManagerType& theManager,
const DOMEntityReferenceType* theXercesDOMEntityReference,
const XercesWrapperNavigator& theNavigator);
1.5 +17 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp
Index: XercesEntityWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesEntityWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesEntityWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -48,7 +48,24 @@
assert(theXercesDOMEntity != 0);
}
+XercesEntityWrapper*
+XercesEntityWrapper::create( MemoryManagerType& theManager,
+ const DOMEntityType* theXercesDOMEntity,
+ const XercesWrapperNavigator& theNavigator)
+{
+ typedef XercesEntityWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMEntity, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesEntityWrapper::~XercesEntityWrapper()
{
1.6 +7 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityWrapper.hpp
Index: XercesEntityWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesEntityWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesEntityWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesEntityWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -21,6 +21,8 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
#include <xalanc/XalanDOM/XalanEntity.hpp>
@@ -44,6 +46,11 @@
public:
XercesEntityWrapper(
+ const DOMEntityType* theXercesDOMEntity,
+ const XercesWrapperNavigator& theNavigator);
+
+ static XercesEntityWrapper*
+ create( MemoryManagerType& theManager,
const DOMEntityType* theXercesDOMEntity,
const XercesWrapperNavigator& theNavigator);
1.5 +16 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesLiaisonXalanDOMStringPool.cpp
Index: XercesLiaisonXalanDOMStringPool.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesLiaisonXalanDOMStringPool.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesLiaisonXalanDOMStringPool.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesLiaisonXalanDOMStringPool.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -23,13 +23,27 @@
-XercesLiaisonXalanDOMStringPool::XercesLiaisonXalanDOMStringPool() :
- ParentType(),
+XercesLiaisonXalanDOMStringPool::XercesLiaisonXalanDOMStringPool(MemoryManagerType& theManager) :
+ ParentType(theManager),
m_mutex()
{
}
+XercesLiaisonXalanDOMStringPool*
+XercesLiaisonXalanDOMStringPool:: create(MemoryManagerType& theManager)
+{
+ typedef XercesLiaisonXalanDOMStringPool ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+ new (theResult) ThisType(theManager);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesLiaisonXalanDOMStringPool::~XercesLiaisonXalanDOMStringPool()
{
1.5 +4 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesLiaisonXalanDOMStringPool.hpp
Index: XercesLiaisonXalanDOMStringPool.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesLiaisonXalanDOMStringPool.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesLiaisonXalanDOMStringPool.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesLiaisonXalanDOMStringPool.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -45,7 +45,10 @@
typedef XERCES_CPP_NAMESPACE_QUALIFIER XMLMutexLock XMLMutexLockType;
explicit
- XercesLiaisonXalanDOMStringPool();
+ XercesLiaisonXalanDOMStringPool(MemoryManagerType& theManager);
+
+ static XercesLiaisonXalanDOMStringPool*
+ create(MemoryManagerType& theManager);
virtual
~XercesLiaisonXalanDOMStringPool();
1.4 +5 -4 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.cpp
Index: XercesNamedNodeMapAttributeList.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XercesNamedNodeMapAttributeList.cpp 26 Feb 2004 23:07:14 -0000 1.3
+++ XercesNamedNodeMapAttributeList.cpp 8 Nov 2004 18:13:57 -0000 1.4
@@ -123,13 +123,14 @@
}
}
-
-
const XMLCh*
-XercesNamedNodeMapAttributeList::getValue(const char* const name) const
+XercesNamedNodeMapAttributeList::getValue(const char* const /*name*/) const
{
- return getValue(c_wstr(TranscodeFromLocalCodePage(name)));
+ assert( 0 );
+
+ return 0;
}
+
1.5 +2 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.hpp
Index: XercesNamedNodeMapAttributeList.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNamedNodeMapAttributeList.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesNamedNodeMapAttributeList.hpp 31 Jul 2004 06:05:11 -0000 1.4
+++ XercesNamedNodeMapAttributeList.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -66,10 +66,9 @@
virtual const XMLCh*
getValue(const XMLCh* const name) const;
- virtual const XMLCh*
- getValue(const char* const name) const;
-
private:
+ virtual const XMLCh*
+ getValue(const char* const name) const;
// Not implemented...
XercesNamedNodeMapAttributeList&
1.5 +18 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp
Index: XercesNotationWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNotationWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesNotationWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesNotationWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -46,6 +46,24 @@
assert(theXercesDOMNotation != 0);
}
+XercesNotationWrapper*
+XercesNotationWrapper::create( MemoryManagerType& theManager,
+ const DOMNotationType* theXercesDOMNotation,
+ const XercesWrapperNavigator& theNavigator)
+
+{
+ typedef XercesNotationWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMNotation, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesNotationWrapper::~XercesNotationWrapper()
1.6 +7 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNotationWrapper.hpp
Index: XercesNotationWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesNotationWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesNotationWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesNotationWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -21,6 +21,8 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
#include <xalanc/XalanDOM/XalanNotation.hpp>
@@ -43,6 +45,11 @@
public:
XercesNotationWrapper(
+ const DOMNotationType* theXercesDOMNotation,
+ const XercesWrapperNavigator& theNavigator);
+
+ static XercesNotationWrapper*
+ create( MemoryManagerType& theManager,
const DOMNotationType* theXercesDOMNotation,
const XercesWrapperNavigator& theNavigator);
1.9 +63 -39 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp
Index: XercesParserLiaison.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesParserLiaison.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XercesParserLiaison.cpp 13 Mar 2004 00:44:56 -0000 1.8
+++ XercesParserLiaison.cpp 8 Nov 2004 18:13:57 -0000 1.9
@@ -38,6 +38,7 @@
#include <xalanc/Include/XalanAutoPtr.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
#include <xalanc/Include/STLHelper.hpp>
@@ -63,8 +64,7 @@
XALAN_CPP_NAMESPACE_BEGIN
-
-XercesParserLiaison::XercesParserLiaison(XercesDOMSupport& /* theSupport */) :
+XercesParserLiaison::XercesParserLiaison(MemoryManagerType& theManager, XercesDOMSupport& /* theSupport */) :
m_indent(-1),
m_useValidation(false),
m_includeIgnorableWhitespace(true),
@@ -72,9 +72,9 @@
m_exitOnFirstFatalError(true),
m_entityResolver(0),
m_errorHandler(this),
- m_externalSchemaLocation(),
- m_externalNoNamespaceSchemaLocation(),
- m_documentMap(),
+ m_externalSchemaLocation(theManager),
+ m_externalNoNamespaceSchemaLocation(theManager),
+ m_documentMap(theManager),
m_buildBridge(true),
m_threadSafe(false),
m_buildMaps(false),
@@ -84,7 +84,7 @@
-XercesParserLiaison::XercesParserLiaison() :
+XercesParserLiaison::XercesParserLiaison(MemoryManagerType& theManager) :
m_indent(-1),
m_useValidation(false),
m_includeIgnorableWhitespace(true),
@@ -92,9 +92,9 @@
m_exitOnFirstFatalError(true),
m_entityResolver(0),
m_errorHandler(this),
- m_externalSchemaLocation(),
- m_externalNoNamespaceSchemaLocation(),
- m_documentMap(),
+ m_externalSchemaLocation(theManager),
+ m_externalNoNamespaceSchemaLocation(theManager),
+ m_documentMap(theManager),
m_buildWrapper(true),
m_buildBridge(true),
m_threadSafe(false),
@@ -123,18 +123,26 @@
if ((*i).second.isDeprecated() == false &&
(*i).second.isOwned() == true)
{
-#if defined(XALAN_CANNOT_DELETE_CONST)
- delete (DOMDocument_Type*)(*i).second.m_wrapper->getXercesDocument();
-#else
- delete (*i).second.m_wrapper->getXercesDocument();
-#endif
+ DOMDocument_Type* docToDelete = const_cast<DOMDocument_Type*>((*i).second.m_wrapper->getXercesDocument());
+
+ if(docToDelete != 0 )
+ {
+ docToDelete->~DOMDocument_Type();
+
+ getMemoryManager().deallocate((void*)docToDelete);
+ }
+
}
-#if defined(XALAN_CANNOT_DELETE_CONST)
- delete (XalanDocument*)(*i).first;
-#else
- delete (*i).first;
-#endif
+ XalanDocument* docToDelete = const_cast<XalanDocument*>((*i).first);
+
+ if(docToDelete != 0)
+ {
+ docToDelete->~XalanDocument();
+
+ getMemoryManager().deallocate((void*)docToDelete);
+ }
+
}
m_documentMap.clear();
@@ -244,7 +252,8 @@
if (i != m_documentMap.end())
{
- const XalanAutoPtr<XalanDocument> theGuard(theDocument);
+ const XalanMemMgrAutoPtr<XalanDocument, true> theGuard(m_documentMap.getMemoryManager(),
+ theDocument);
m_documentMap.erase(i);
}
@@ -284,10 +293,12 @@
-const XalanDOMString
-XercesParserLiaison::getParserDescription() const
+const XalanDOMString&
+XercesParserLiaison::getParserDescription(XalanDOMString& theResult) const
{
- return StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("Xerces"));
+ theResult.assign("Xerces");
+
+ return theResult;
}
@@ -526,7 +537,9 @@
void
XercesParserLiaison::fatalError(const SAXParseExceptionType& e)
{
- XalanDOMString theMessage = XalanMessageLoader::getMessage(XalanMessages::FatalError);
+ XalanDOMString theMessage( getMemoryManager());
+
+ XalanMessageLoader::getMessage(XalanMessages::FatalError, theMessage);
formatErrorMessage(e, theMessage);
@@ -552,7 +565,8 @@
void
XercesParserLiaison::error(const SAXParseExceptionType& e)
{
- XalanDOMString theMessage = XalanMessageLoader::getMessage(XalanMessages::Error2);
+ XalanDOMString theMessage( getMemoryManager());
+ XalanMessageLoader::getMessage(XalanMessages::Error2, theMessage);
formatErrorMessage(e, theMessage);
@@ -581,7 +595,9 @@
void
XercesParserLiaison::warning(const SAXParseExceptionType& e)
{
- XalanDOMString theMessage = XalanMessageLoader::getMessage(XalanMessages::Warning2);
+ XalanDOMString theMessage( getMemoryManager());
+
+ XalanMessageLoader::getMessage(XalanMessages::Warning2,theMessage );
formatErrorMessage(e, theMessage);
@@ -608,21 +624,29 @@
const XalanDOMChar* const theSystemID = e.getSystemId();
+ XalanDOMString theLineNumber( theMessage.getMemoryManager());
+ XalanDOMString theColumnNumb( theMessage.getMemoryManager());
+
+ LongToDOMString(long(e.getLineNumber()), theLineNumber);
+ LongToDOMString(long(e.getColumnNumber()), theColumnNumb);
+
+ XalanDOMString theErrorMsg( theMessage.getMemoryManager());
+
if (theSystemID == 0 || length(theSystemID) == 0)
{
-
- append(theMessage,XalanMessageLoader::getMessage(XalanMessages::AtUnknownFileLineColumn_2Param
- ,LongToDOMString(long(e.getLineNumber()))
- ,LongToDOMString(long(e.getColumnNumber()))
- ));
+
+ append(theMessage,XalanMessageLoader::getMessage(XalanMessages::AtUnknownFileLineColumn_2Param,
+ theErrorMsg,
+ theLineNumber,
+ theColumnNumb));
}
else
{
- append(theMessage,XalanMessageLoader::getMessage(XalanMessages::AtFileLineColumn_3Param
- ,XalanDOMString(theSystemID)
- ,LongToDOMString(long(e.getLineNumber()))
- ,LongToDOMString(long(e.getColumnNumber()))
- ));
+ append(theMessage,XalanMessageLoader::getMessage(XalanMessages::AtFileLineColumn_3Param,
+ theErrorMsg,
+ XalanDOMString(theSystemID, theMessage.getMemoryManager()),
+ theLineNumber,
+ theColumnNumb));
}
append(theMessage, e.getMessage());
@@ -640,7 +664,7 @@
XercesParserLiaison::DOMParserType*
XercesParserLiaison::CreateDOMParser()
{
- DOMParserType* const theParser = new DOMParserType;
+ DOMParserType* const theParser = new DOMParserType(0,&(getMemoryManager()));
theParser->setExpandEntityReferences(true);
@@ -683,7 +707,7 @@
XercesParserLiaison::SAXParserType*
XercesParserLiaison::CreateSAXParser()
{
- SAXParserType* const theParser = new SAXParserType;
+ SAXParserType* const theParser = new SAXParserType(0,&(getMemoryManager()));
theParser->setDoValidation(false);
@@ -730,7 +754,7 @@
bool isOwned)
{
XercesDocumentWrapper* const theNewDocument =
- new XercesDocumentWrapper(theXercesDocument, threadSafe, buildWrapper, buildMaps);
+ XercesDocumentWrapper::create(getMemoryManager(),theXercesDocument, threadSafe, buildWrapper, buildMaps);
DocumentEntry& theEntry = m_documentMap[theNewDocument];
1.9 +14 -6 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesParserLiaison.hpp
Index: XercesParserLiaison.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesParserLiaison.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XercesParserLiaison.hpp 31 Aug 2004 14:20:28 -0000 1.8
+++ XercesParserLiaison.hpp 8 Nov 2004 18:13:57 -0000 1.9
@@ -71,6 +71,7 @@
public XMLParserLiaison,
public ErrorHandlerType
{
+
public:
typedef XERCES_CPP_NAMESPACE_QUALIFIER SAXParser SAXParserType;
@@ -82,17 +83,24 @@
*
* @deprecated This constructor is deprecated. Use the next constructor instead.
*/
- XercesParserLiaison(XercesDOMSupport& theSupport);
+ XercesParserLiaison(MemoryManagerType& theManager, XercesDOMSupport& theSupport);
/**
* Construct a XercesParserLiaison instance.
*/
- XercesParserLiaison();
+ XercesParserLiaison(MemoryManagerType& theManager);
virtual
~XercesParserLiaison();
+
+
// These interfaces are inherited from XMLParserLiaison...
+ MemoryManagerType&
+ getMemoryManager()
+ {
+ return m_externalSchemaLocation.getMemoryManager();
+ }
virtual void
reset();
@@ -106,13 +114,13 @@
virtual XalanDocument*
parseXMLStream(
const InputSourceType& reader,
- const XalanDOMString& identifier = XalanDOMString());
+ const XalanDOMString& identifier = XalanDOMString(XalanMemMgrs::getDummyMemMgr()));
virtual void
parseXMLStream(
const InputSourceType& urlInputSource,
DocumentHandlerType& handler,
- const XalanDOMString& identifier = XalanDOMString());
+ const XalanDOMString& identifier = XalanDOMString(XalanMemMgrs::getDummyMemMgr()));
virtual void
destroyDocument(XalanDocument* theDocument);
@@ -129,8 +137,8 @@
virtual void
setUseValidation(bool b);
- virtual const XalanDOMString
- getParserDescription() const;
+ virtual const XalanDOMString&
+ getParserDescription(XalanDOMString& theResult) const;
virtual EntityResolverType*
getEntityResolver() const;
1.5 +17 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp
Index: XercesProcessingInstructionWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesProcessingInstructionWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesProcessingInstructionWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -46,7 +46,24 @@
assert(theXercesDOMProcessingInstruction != 0);
}
+XercesProcessingInstructionWrapper*
+XercesProcessingInstructionWrapper::create( MemoryManagerType& theManager,
+ const DOMProcessingInstructionType* theXercesDOMProcessingInstruction,
+ const XercesWrapperNavigator& theNavigator)
+{
+ typedef XercesProcessingInstructionWrapper ThisType;
+
+ XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+
+ ThisType* theResult = theGuard.get();
+
+ new (theResult) ThisType(theXercesDOMProcessingInstruction, theNavigator);
+
+ theGuard.release();
+
+ return theResult;
+}
XercesProcessingInstructionWrapper::~XercesProcessingInstructionWrapper()
{
1.6 +7 -0 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.hpp
Index: XercesProcessingInstructionWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesProcessingInstructionWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesProcessingInstructionWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesProcessingInstructionWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -21,6 +21,8 @@
#include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp>
+#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
#include <xalanc/XalanDOM/XalanProcessingInstruction.hpp>
@@ -43,6 +45,11 @@
public:
XercesProcessingInstructionWrapper(
+ const DOMProcessingInstructionType* theXercesDOMProcessingInstruction,
+ const XercesWrapperNavigator& theNavigator);
+
+ static XercesProcessingInstructionWrapper*
+ create( MemoryManagerType& theManager,
const DOMProcessingInstructionType* theXercesDOMProcessingInstruction,
const XercesWrapperNavigator& theNavigator);
1.5 +6 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapper.cpp
Index: XercesTextWrapper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesTextWrapper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesTextWrapper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -301,12 +301,15 @@
-XalanDOMString
+XalanDOMString&
XercesTextWrapper::substringData(
unsigned int offset,
- unsigned int count) const
+ unsigned int count,
+ XalanDOMString& theResult) const
{
- return XercesWrapperHelper::substringData(m_xercesNode, offset, count);
+ XercesWrapperHelper::substringData(m_xercesNode, offset, count, theResult);
+
+ return theResult;
}
1.6 +3 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapper.hpp
Index: XercesTextWrapper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesTextWrapper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesTextWrapper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -441,10 +441,11 @@
* <br>DOMSTRING_SIZE_ERR: Raised if the specified range of text does not
* fit into a <code>DOMString</code>.
*/
- virtual XalanDOMString
+ virtual XalanDOMString&
substringData(
unsigned int offset,
- unsigned int count) const;
+ unsigned int count,
+ XalanDOMString& theResult) const;
//@}
/** @name Functions that set or change data. */
1.5 +2 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapperAllocator.cpp
Index: XercesTextWrapperAllocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapperAllocator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesTextWrapperAllocator.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesTextWrapperAllocator.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -23,8 +23,8 @@
-XercesTextWrapperAllocator::XercesTextWrapperAllocator(size_type theBlockCount) :
- m_allocator(theBlockCount)
+XercesTextWrapperAllocator::XercesTextWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount) :
+ m_allocator(theManager, theBlockCount)
{
}
1.5 +1 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapperAllocator.hpp
Index: XercesTextWrapperAllocator.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesTextWrapperAllocator.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesTextWrapperAllocator.hpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesTextWrapperAllocator.hpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -58,7 +58,7 @@
*
* @param theBlockSize The block size.
*/
- XercesTextWrapperAllocator(size_type theBlockCount);
+ XercesTextWrapperAllocator(MemoryManagerType& theManager, size_type theBlockCount);
~XercesTextWrapperAllocator();
1.5 +5 -3 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperHelper.cpp
Index: XercesWrapperHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperHelper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesWrapperHelper.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesWrapperHelper.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -46,11 +46,12 @@
-const XalanDOMString
+const XalanDOMString&
XercesWrapperHelper::substringData(
const DOMCharacterDataType* theXercesNode,
unsigned int offset,
- unsigned int count)
+ unsigned int count,
+ XalanDOMString& theResult)
{
assert(theXercesNode != 0);
@@ -58,7 +59,8 @@
{
const XMLCh* const theString = theXercesNode->substringData(offset, count);
- return XalanDOMString(theString, XalanDOMString::length(theString));
+ theResult.assign(theString, XalanDOMString::length(theString));
+ return theResult;
}
catch(const DOMExceptionType& theException)
{
1.6 +3 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperHelper.hpp
Index: XercesWrapperHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperHelper.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesWrapperHelper.hpp 26 Feb 2004 23:07:14 -0000 1.5
+++ XercesWrapperHelper.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -62,11 +62,12 @@
const XalanDOMString& feature,
const XalanDOMString& version);
- static const XalanDOMString
+ static const XalanDOMString&
substringData(
const DOMCharacterDataType* theXercesNode,
unsigned int offset,
- unsigned int count);
+ unsigned int count,
+ XalanDOMString& theResult);
private:
1.5 +1 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigator.cpp
Index: XercesWrapperNavigator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesWrapperNavigator.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesWrapperNavigator.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -33,7 +33,7 @@
-const XalanDOMString XercesWrapperNavigator::s_emptyString;
+const XalanDOMString XercesWrapperNavigator::s_emptyString(XalanMemMgrs::getDummyMemMgr());
1.2 +2 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigatorAllocator.cpp
Index: XercesWrapperNavigatorAllocator.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigatorAllocator.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XercesWrapperNavigatorAllocator.cpp 12 Aug 2004 23:48:00 -0000 1.1
+++ XercesWrapperNavigatorAllocator.cpp 8 Nov 2004 18:13:57 -0000 1.2
@@ -23,8 +23,8 @@
-XercesWrapperNavigatorAllocator::XercesWrapperNavigatorAllocator(size_type theBlockCount) :
- m_allocator(theBlockCount)
+XercesWrapperNavigatorAllocator::XercesWrapperNavigatorAllocator(MemoryManagerType& theManager, size_type theBlockCount) :
+ m_allocator(theManager, theBlockCount)
{
}
1.2 +2 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigatorAllocator.hpp
Index: XercesWrapperNavigatorAllocator.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperNavigatorAllocator.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XercesWrapperNavigatorAllocator.hpp 12 Aug 2004 23:48:00 -0000 1.1
+++ XercesWrapperNavigatorAllocator.hpp 8 Nov 2004 18:13:57 -0000 1.2
@@ -57,7 +57,8 @@
*
* @param theBlockSize The block size.
*/
- XercesWrapperNavigatorAllocator(size_type theBlockCount);
+ XercesWrapperNavigatorAllocator(MemoryManagerType& theManager,
+ size_type theBlockCount);
~XercesWrapperNavigatorAllocator();
1.5 +2 -2 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperToXalanNodeMap.cpp
Index: XercesWrapperToXalanNodeMap.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperToXalanNodeMap.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XercesWrapperToXalanNodeMap.cpp 26 Feb 2004 23:07:14 -0000 1.4
+++ XercesWrapperToXalanNodeMap.cpp 8 Nov 2004 18:13:57 -0000 1.5
@@ -34,8 +34,8 @@
-XercesWrapperToXalanNodeMap::XercesWrapperToXalanNodeMap() :
- m_xercesMap()
+XercesWrapperToXalanNodeMap::XercesWrapperToXalanNodeMap(MemoryManagerType& theManager) :
+ m_xercesMap(theManager)
{
}
1.6 +7 -1 xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperToXalanNodeMap.hpp
Index: XercesWrapperToXalanNodeMap.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XercesParserLiaison/XercesWrapperToXalanNodeMap.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XercesWrapperToXalanNodeMap.hpp 31 Aug 2004 14:20:28 -0000 1.5
+++ XercesWrapperToXalanNodeMap.hpp 8 Nov 2004 18:13:57 -0000 1.6
@@ -46,9 +46,15 @@
typedef XalanMap<const DOMNodeType*, XalanNode*> XercesNodeMapType;
- XercesWrapperToXalanNodeMap();
+ XercesWrapperToXalanNodeMap(MemoryManagerType& theManager);
~XercesWrapperToXalanNodeMap();
+
+ MemoryManagerType&
+ getMemoryManager()
+ {
+ return m_xercesMap.getMemoryManager();
+ }
void
addAssociation(
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org