xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject svn commit: r719046 [5/6] - in /xalan/c/trunk: Projects/Win32/VC6/AllInOne/ Projects/Win32/VC7.1/AllInOne/ Projects/Win32/VC7/AllInOne/ Projects/Win32/VC8/AllInOne/ Projects/Win32/VC9/AllInOne/ src/xalanc/Harness/ src/xalanc/ICUBridge/ src/xalanc/Inclu...
Date Wed, 19 Nov 2008 20:07:07 GMT
Propchange: xalan/c/trunk/Projects/Win32/VC9/AllInOne/AllInOneWithICU.vcproj
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp (original)
+++ xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp Wed Nov 19 12:07:05 2008
@@ -853,7 +853,9 @@
 
     theTreeWalker.traverse(dom);
 
-    destroyObjWithMemMgr(theFormatter, getMemoryManager());
+    XalanDestroy(
+        getMemoryManager(),
+        theFormatter);
 
     XalanSourceTreeDOMSupport       domSupport;
     XalanSourceTreeParserLiaison    parserLiaison(domSupport, getMemoryManager());

Modified: xalan/c/trunk/src/xalanc/Harness/XalanXMLFileReporter.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Harness/XalanXMLFileReporter.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Harness/XalanXMLFileReporter.hpp (original)
+++ xalan/c/trunk/src/xalanc/Harness/XalanXMLFileReporter.hpp Wed Nov 19 12:07:05 2008
@@ -33,7 +33,6 @@
 
 
 #include "xalanc/Include/XalanAutoPtr.hpp"
-#include "xalanc/Include/XalanMemMgrHelper.hpp"
 #include "xalanc/Include/XalanMap.hpp"
 #include "xalanc/Include/XalanVector.hpp"
 

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctor.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctor.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctor.cpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctor.cpp Wed Nov 19 12:07:05 2008
@@ -23,7 +23,6 @@
 #include "ICUBridge.hpp"
 #include "ICUBridgeCollationCompareFunctorImpl.hpp"
 
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
 XALAN_CPP_NAMESPACE_BEGIN

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctorImpl.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctorImpl.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctorImpl.cpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUBridgeCollationCompareFunctorImpl.cpp Wed Nov 19 12:07:05 2008
@@ -114,21 +114,23 @@
     }
 }
 
-ICUBridgeCollationCompareFunctorImpl*
-ICUBridgeCollationCompareFunctorImpl::create (MemoryManager& theManager , bool  fCacheCollators) 
-{
-    typedef ICUBridgeCollationCompareFunctorImpl ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-    ThisType* theResult = theGuard.get();
 
-    new (theResult) ThisType(theManager, fCacheCollators);
+    
+ICUBridgeCollationCompareFunctorImpl*
+ICUBridgeCollationCompareFunctorImpl::create(
+            MemoryManager&  theManager,
+            bool            fCacheCollators) 
+{
+    ICUBridgeCollationCompareFunctorImpl*   theInstance;
+
+    return XalanConstruct(
+                theManager,
+                theInstance,
+                theManager,
+                fCacheCollators);
+}
 
-   theGuard.release();
 
-    return theResult;
-}
 
 ICUBridgeCollationCompareFunctorImpl::~ICUBridgeCollationCompareFunctorImpl()
 {

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.cpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.cpp Wed Nov 19 12:07:05 2008
@@ -60,13 +60,12 @@
 ICUFormatNumberFunctor*
 ICUFormatNumberFunctor::create(MemoryManager& theManager) 
 {
-    typedef ICUFormatNumberFunctor ThisType;
+    typedef ICUFormatNumberFunctor  ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theManager);
 
     theGuard.release();
 

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.hpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUFormatNumberFunctor.hpp Wed Nov 19 12:07:05 2008
@@ -255,7 +255,7 @@
 
     const DFAutoPtrType                 m_defaultDecimalFormat;
 
-    MemoryManager&                  m_memoryManager;
+    MemoryManager&                      m_memoryManager;
 };
 
 

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatFactory.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatFactory.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatFactory.cpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatFactory.cpp Wed Nov 19 12:07:05 2008
@@ -45,17 +45,9 @@
 XalanNumberFormat*
 ICUXalanNumberFormatFactory::create()
 {
-    typedef ICUXalanNumberFormatProxy ThisType;
+    ICUXalanNumberFormatProxy*  theInstance;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( m_memoryManager , (ThisType*)m_memoryManager.allocate(sizeof(ThisType)));
-
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(m_memoryManager);
-
-   theGuard.release();
-
-   return theResult;
+    return XalanConstruct(m_memoryManager, theInstance, m_memoryManager);
 }
 
 

Modified: xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatProxy.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatProxy.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatProxy.cpp (original)
+++ xalan/c/trunk/src/xalanc/ICUBridge/ICUXalanNumberFormatProxy.cpp Wed Nov 19 12:07:05 2008
@@ -30,8 +30,6 @@
 #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
 
 
-#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
-
 
 #include "ICUBridge.hpp"
 
@@ -41,7 +39,7 @@
 
 
 
-ICUXalanNumberFormatProxy::ICUXalanNumberFormatProxy(MemoryManager& theManager) :
+ICUXalanNumberFormatProxy::ICUXalanNumberFormatProxy(MemoryManager&     theManager) :
     XalanNumberFormat(theManager),
     m_decimalFormat(0)
 {

Modified: xalan/c/trunk/src/xalanc/Include/XalanAutoPtr.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Include/XalanAutoPtr.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Include/XalanAutoPtr.hpp (original)
+++ xalan/c/trunk/src/xalanc/Include/XalanAutoPtr.hpp Wed Nov 19 12:07:05 2008
@@ -47,7 +47,7 @@
     }
 
     XalanAutoPtr(const XalanAutoPtr<Type>&  theSource) :
-        m_pointer(((XalanAutoPtr<Type>&)theSource).release())
+        m_pointer(const_cast<XalanAutoPtr<Type>&>(theSource).release())
     {
     }
 

Modified: xalan/c/trunk/src/xalanc/Include/XalanMemMgrAutoPtr.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Include/XalanMemMgrAutoPtr.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Include/XalanMemMgrAutoPtr.hpp (original)
+++ xalan/c/trunk/src/xalanc/Include/XalanMemMgrAutoPtr.hpp Wed Nov 19 12:07:05 2008
@@ -42,9 +42,7 @@
 XALAN_USING_XERCES(MemoryManager)
 
 // An auto_ptr-like class that supports the MemoryManager class.
-template<
-            class   Type, 
-            bool    toCallDestructor = true>
+template<class   Type>
 class XalanMemMgrAutoPtr
 {
 public:
@@ -54,6 +52,7 @@
     class MemMgrAutoPtrData : public AutoPtrPairType
     {
     public:
+
         MemMgrAutoPtrData():
             AutoPtrPairType(0,0)
         {
@@ -66,7 +65,7 @@
         {
             invariants();
         }
-        
+
         bool
         isInitilized()const
         {
@@ -78,12 +77,9 @@
         {
             invariants();
 
-            if ( isInitilized() )
+            if (isInitilized())
             {       
-                if ( toCallDestructor ) 
-                {
-                    this->second->~Type();
-                }
+                this->second->~Type();
 
                 this->first->deallocate(this->second);
             }
@@ -91,8 +87,8 @@
 
         void 
         reset(
-                MemoryManager*      memoryManager ,
-                Type*               dataPointer)
+                MemoryManager*  memoryManager,
+                Type*           dataPointer)
         {   
             invariants();
 
@@ -127,13 +123,13 @@
     {
     }
 
-    XalanMemMgrAutoPtr(const XalanMemMgrAutoPtr<Type, toCallDestructor>&    theSource) :
-        m_pointerInfo(((XalanMemMgrAutoPtr<Type>&)theSource).release())
+    XalanMemMgrAutoPtr(const XalanMemMgrAutoPtr<Type>&    theSource) :
+        m_pointerInfo(const_cast<XalanMemMgrAutoPtr<Type>&>(theSource).release())
     {
     }
 
-    XalanMemMgrAutoPtr<Type,toCallDestructor>&
-    operator=(XalanMemMgrAutoPtr<Type,toCallDestructor>&    theRHS)
+    XalanMemMgrAutoPtr<Type>&
+    operator=(XalanMemMgrAutoPtr<Type>&    theRHS)
     {       
         if (this != &theRHS)
         {

Modified: xalan/c/trunk/src/xalanc/Include/XalanMemoryManagement.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Include/XalanMemoryManagement.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Include/XalanMemoryManagement.hpp (original)
+++ xalan/c/trunk/src/xalanc/Include/XalanMemoryManagement.hpp Wed Nov 19 12:07:05 2008
@@ -298,6 +298,74 @@
     class Type,
     class Param1Type,
     class Param2Type,
+    class Param3Type,
+    class Param4Type>
+Type*
+XalanConstruct(
+            MemoryManager&      theMemoryManager,
+            Type*&              theInstance,
+            const Param1Type*   theParam1,
+            const Param2Type*   theParam2,
+            const Param3Type*   theParam3,
+            Param4Type&         theParam4)
+{
+    XalanAllocationGuard    theGuard(
+                                theMemoryManager,
+                                sizeof(Type));
+
+    theInstance =
+        new (theGuard.get()) Type(theParam1, theParam2, theParam3, theParam4);
+
+    theGuard.release();
+
+    return theInstance;
+}
+
+
+
+template<
+    class Type,
+    class Param1Type,
+    class Param2Type,
+    class Param3Type,
+    class Param4Type,
+    class Param5Type,
+    class Param6Type>
+Type*
+XalanConstruct(
+            MemoryManager&      theMemoryManager,
+            Type*&              theInstance,
+            const Param1Type*   theParam1,
+            const Param2Type*   theParam2,
+            const Param3Type*   theParam3,
+            const Param4Type*   theParam4,
+            const Param5Type*   theParam5,
+            Param6Type&         theParam6)
+{
+    XalanAllocationGuard    theGuard(
+                                theMemoryManager,
+                                sizeof(Type));
+
+    theInstance =
+        new (theGuard.get()) Type(
+                                theParam1,
+                                theParam2,
+                                theParam3,
+                                theParam4,
+                                theParam5,
+                                theParam6);
+
+    theGuard.release();
+
+    return theInstance;
+}
+
+
+
+template<
+    class Type,
+    class Param1Type,
+    class Param2Type,
     class Param3Type>
 Type*
 XalanConstruct(

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/AttributeListImpl.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/AttributeListImpl.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/AttributeListImpl.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/AttributeListImpl.cpp Wed Nov 19 12:07:05 2008
@@ -392,7 +392,7 @@
             m_AttributeVector.reserve(eDefaultVectorSize);
         }
         
-        typedef XalanMemMgrAutoPtr<AttributeVectorEntry,true> AutoPtr;
+        typedef XalanMemMgrAutoPtr<AttributeVectorEntry>    AutoPtr;
 
         AutoPtr theEntry(getMemoryManager(), getNewEntry(name, type, value));
 

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntry.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntry.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntry.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntry.hpp Wed Nov 19 12:07:05 2008
@@ -45,7 +45,7 @@
             const XMLChVectorType&  theName,
             const XMLChVectorType&  theValue,
             const XMLChVectorType&  theType,
-            MemoryManager&      theManager) :
+            MemoryManager&          theManager) :
         m_Name(theName,theManager),
         m_Value(theValue,theManager),
         m_Type(theType,theManager)
@@ -53,10 +53,10 @@
     }
 
     AttributeVectorEntry(
-            const XMLCh*            theName,
-            const XMLCh*            theValue,
-            const XMLCh*            theType,
-            MemoryManager&      theManager) :
+            const XMLCh*    theName,
+            const XMLCh*    theValue,
+            const XMLCh*    theType,
+            MemoryManager&  theManager) :
         m_Name(theName, theName + length(theName) + 1, theManager),
         m_Value(theValue, theValue + length(theValue) + 1, theManager),
         m_Type(theType, theType + length(theType) + 1, theManager)
@@ -71,22 +71,21 @@
     }
 
     static AttributeVectorEntry*
-    create( const XMLCh*    theName,
+    create(
+            const XMLCh*    theName,
             const XMLCh*    theValue,
             const XMLCh*    theType,
-            MemoryManager&      theManager)
+            MemoryManager&  theManager)
     {
-        typedef AttributeVectorEntry ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-        ThisType* theResult = theGuard.get();
-
-        new (theResult) ThisType(theName, theValue, theType, theManager);
-
-        theGuard.release();
+        AttributeVectorEntry*  theInstance;
 
-        return theResult;
+        return XalanConstruct(
+                theManager,
+                theInstance,
+                theName,
+                theValue,
+                theType,
+                theManager);
     }
 
     virtual

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntryExtended.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntryExtended.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntryExtended.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/AttributeVectorEntryExtended.hpp Wed Nov 19 12:07:05 2008
@@ -43,10 +43,18 @@
             const XMLChVectorType&  theType,
             const XMLChVectorType&  theURI ,
             const XMLChVectorType&  theLocalName,
-            MemoryManager&      theManager) :
-        AttributeVectorEntry(theName, theValue, theType, theManager),
-        m_uri(theURI, theManager),
-        m_localName(theLocalName, theManager)
+            MemoryManager&          theManager) :
+        AttributeVectorEntry(
+            theName,
+            theValue,
+            theType,
+            theManager),
+        m_uri(
+            theURI,
+            theManager),
+        m_localName(
+            theLocalName,
+            theManager)
     {
     }
 
@@ -56,10 +64,20 @@
             const XMLCh*    theType,
             const XMLCh*    theURI,
             const XMLCh*    theLocalName,
-            MemoryManager&      theManager) :
-        AttributeVectorEntry(theName, theValue, theType, theManager),
-        m_uri(theURI, theURI + length(theURI) + 1, theManager),
-        m_localName(theLocalName, theLocalName + length(theLocalName) + 1,theManager)
+            MemoryManager&  theManager) :
+        AttributeVectorEntry(
+            theName,
+            theValue,
+            theType,
+            theManager),
+        m_uri(
+            theURI,
+            theURI + length(theURI) + 1,
+            theManager),
+        m_localName(
+            theLocalName,
+            theLocalName + length(theLocalName) + 1,
+            theManager)
     {
     }
 
@@ -68,13 +86,16 @@
             const XMLCh*    theValue,
             const XMLCh*    theType,
             MemoryManager&      theManager) :
-        AttributeVectorEntry(theName, theValue, theType,theManager),
+        AttributeVectorEntry(
+            theName,
+            theValue,
+            theType,theManager),
         m_uri(theManager),
         m_localName(theManager)
     {
     }
 
-    AttributeVectorEntryExtended(MemoryManager&      theManager) :
+    AttributeVectorEntryExtended(MemoryManager&     theManager) :
         AttributeVectorEntry(theManager),
         m_uri(theManager),
         m_localName(theManager)
@@ -88,19 +109,19 @@
             const XMLCh*    theType,
             const XMLCh*    theURI,
             const XMLCh*    theLocalName,
-            MemoryManager&      theManager)
+            MemoryManager&  theManager)
     {
-        typedef AttributeVectorEntryExtended ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-        ThisType* theResult = theGuard.get();
-
-        new (theResult) ThisType(theName, theValue, theType, theURI, theLocalName, theManager);
-
-        theGuard.release();
+        AttributeVectorEntryExtended*   theInstance;
 
-        return theResult;
+        return XalanConstruct(
+                theManager,
+                theInstance,
+                theName,
+                theValue,
+                theType,
+                theURI,
+                theLocalName,
+                theManager);
     }
 
     virtual

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/AttributesImpl.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/AttributesImpl.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/AttributesImpl.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/AttributesImpl.cpp Wed Nov 19 12:07:05 2008
@@ -59,8 +59,9 @@
 
 
 
-AttributesImpl::AttributesImpl(const AttributesImpl&    theSource,
-                               MemoryManager&      theManager) :
+AttributesImpl::AttributesImpl(
+            const AttributesImpl&   theSource,
+            MemoryManager&          theManager) :
     AttributesType(),
     m_attributesVector(theManager),
     m_cacheVector(theManager)
@@ -495,7 +496,7 @@
         m_attributesVector.reserve(eDefaultVectorSize);
     }
 
-    typedef XalanMemMgrAutoPtr<AttributeVectorEntryExtended,true> AutoPtr;
+    typedef XalanMemMgrAutoPtr<AttributeVectorEntryExtended>    AutoPtr;
 
     AutoPtr theEntry(getMemoryManager(), getNewEntry(name, type, value, uri, localName));
 

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanArrayAllocator.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanArrayAllocator.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanArrayAllocator.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanArrayAllocator.hpp Wed Nov 19 12:07:05 2008
@@ -28,7 +28,7 @@
 #include <utility>
 
 
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
+
 #include <xalanc/Include/XalanVector.hpp>
 #include <xalanc/Include/XalanList.hpp>
 

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanFStreamOutputStream.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanFStreamOutputStream.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanFStreamOutputStream.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanFStreamOutputStream.cpp Wed Nov 19 12:07:05 2008
@@ -47,20 +47,20 @@
     
 XalanFStreamOutputStream*
 XalanFStreamOutputStream::create(
-            FILE*               theFileHandle,
+            FILE*           theFileHandle,
             MemoryManager&  theManager,
-            size_type           theBufferSize)
+            size_type       theBufferSize)
 {
-    typedef XalanFStreamOutputStream ThisType;
+    typedef XalanFStreamOutputStream    ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                        theFileHandle,
+                        theManager,
+                        theBufferSize);
 
-    new (theResult) ThisType(theFileHandle,
-                             theManager,
-                             theBufferSize);
-                             
     theGuard.release();
 
     return theResult;

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanFileOutputStream.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanFileOutputStream.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanFileOutputStream.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanFileOutputStream.cpp Wed Nov 19 12:07:05 2008
@@ -223,29 +223,31 @@
 #endif
 }
 
+
+
 XalanFileOutputStream*
 XalanFileOutputStream::create(
             const XalanDOMString&   theFileName,
-            MemoryManager&      theManager,
+            MemoryManager&          theManager,
             size_type               theBufferSize)
 {
-    typedef XalanFileOutputStream ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XalanFileOutputStream   ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(           
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
                         theFileName,
                         theManager,
                         theBufferSize);
 
-                            
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XalanFileOutputStream::~XalanFileOutputStream()
 {
 #if defined(XALAN_WINDOWS)

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanMessageLoader.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanMessageLoader.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanMessageLoader.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanMessageLoader.hpp Wed Nov 19 12:07:05 2008
@@ -23,10 +23,14 @@
 #include "xalanc/PlatformSupport/PlatformSupportDefinitions.hpp"
 
 
-#include "xalanc/XalanDOM/XalanDOMString.hpp"
 
 #include "xalanc/Include/XalanMemMgrAutoPtr.hpp"
-#include "xalanc/Include/XalanMemMgrHelper.hpp"
+
+
+
+#include "xalanc/XalanDOM/XalanDOMString.hpp"
+
+
 
 #include "LocalMsgIndex.hpp"
 
@@ -49,14 +53,14 @@
     class XalanMessageLoaderCreateFunct
     {
     public:
+
         Type*
         operator()(MemoryManager&   theManager)
         {
-            XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
+            XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(Type)));
 
-            Type* theResult = theGuard.get();
-
-            new (theResult) Type(theManager);
+            Type* const     theResult =
+                    new (theGuard.get()) Type(theManager);
 
             theGuard.release();
 
@@ -71,10 +75,10 @@
         operator()(
                     MemoryManager&          theManager,
                     XalanMessageLoader*     p)
-        {        
-            assert ( p != 0);
+        {
+            assert (p != 0);
 
-            destroyObjWithMemMgr(p, theManager);
+            XalanDestroy(theManager, p);
         }
     };
 

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanNumberFormat.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanNumberFormat.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanNumberFormat.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanNumberFormat.cpp Wed Nov 19 12:07:05 2008
@@ -19,9 +19,6 @@
 
 
 
-#include <xalanc/Include/XalanMemMngArrayAllocate.hpp>
-
-
 #include <xalanc/Include/STLHelper.hpp>
 
 
@@ -189,18 +186,15 @@
             // Add two, so we leave one byte at the beginning as empty space
             const XalanDOMString::size_type     bufsize = len + len / m_groupingSize + 2;
 
-            typedef XalanMemMngArrayAllocate<XalanDOMChar> XalanDOMCharHeapAllocator;
-
-            XalanDOMChar* const     buffer = XalanDOMCharHeapAllocator::allocate( bufsize, 
-                                                                                 result.getMemoryManager());
+            XalanVector<XalanDOMChar>   theGuard(result.getMemoryManager());
 
-            XalanMemMgrAutoPtrArray<XalanDOMChar>       theGuard(result.getMemoryManager(),
-                                                                  buffer,
-                                                                  bufsize);
+            theGuard.resize(bufsize);
 
-            XalanDOMChar*           p = buffer + bufsize - 1;
+            XalanDOMChar* const     buffer = &*theGuard.begin();
+            XalanDOMChar*   p = &theGuard.back();
 
-            *p-- = 0;   // null terminate
+            // Leave a null-terminator.
+            --p;
 
             for (XalanDOMString::size_type i = 0, ix = len - 1; i < len && p > buffer; i++, ix--)
             {

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanOutputStreamPrintWriter.cpp Wed Nov 19 12:07:05 2008
@@ -46,26 +46,32 @@
     m_flushWideChars(false)
 {
 }
+
+
+
 XalanOutputStreamPrintWriter*
 XalanOutputStreamPrintWriter::create(
             XalanOutputStream&  theOutputStream,
             bool                fAutoFlush) 
 {
-    typedef XalanOutputStreamPrintWriter ThisType;
+    typedef XalanOutputStreamPrintWriter    ThisType;
 
-    MemoryManager& theManager = theOutputStream.getMemoryManager();
+    MemoryManager&  theManager = theOutputStream.getMemoryManager();
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theOutputStream, fAutoFlush);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                        theOutputStream,
+                        fAutoFlush);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XalanOutputStreamPrintWriter::~XalanOutputStreamPrintWriter()
 {
     flush();

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanStdOutputStream.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanStdOutputStream.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanStdOutputStream.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanStdOutputStream.cpp Wed Nov 19 12:07:05 2008
@@ -81,13 +81,14 @@
             StreamType&     theOutputStream,
             MemoryManager&  theManager)
 {
-    typedef XalanStdOutputStream ThisType;
+    typedef XalanStdOutputStream    ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theOutputStream, theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                        theOutputStream,
+                        theManager);
 
     theGuard.release();
 

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanToXercesTranscoderWrapper.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanToXercesTranscoderWrapper.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanToXercesTranscoderWrapper.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanToXercesTranscoderWrapper.cpp Wed Nov 19 12:07:05 2008
@@ -37,29 +37,37 @@
 
 
 
-XalanToXercesTranscoderWrapper::XalanToXercesTranscoderWrapper(MemoryManager& theManager, XMLTranscoderType&    theTranscoder) :
+XalanToXercesTranscoderWrapper::XalanToXercesTranscoderWrapper(
+            MemoryManager&      theManager,
+            XMLTranscoderType&  theTranscoder) :
     XalanOutputTranscoder(theManager),
     m_transcoder(&theTranscoder)
 {
 }
 
+
+
 XalanToXercesTranscoderWrapper*
-XalanToXercesTranscoderWrapper::create(MemoryManager& theManager, XMLTranscoderType&    theTranscoder)
+XalanToXercesTranscoderWrapper::create(
+            MemoryManager&      theManager,
+            XMLTranscoderType&  theTranscoder)
 {
-    typedef XalanToXercesTranscoderWrapper ThisType;
+    typedef XalanToXercesTranscoderWrapper  ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                        theManager,
+                        theTranscoder);
 
-    new (theResult) ThisType(theManager, theTranscoder);
-
-   theGuard.release();
+    theGuard.release();
 
     return theResult;
 }
 
 
+
 XalanToXercesTranscoderWrapper::~XalanToXercesTranscoderWrapper()
 {
     delete m_transcoder;

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/XalanUTF16Transcoder.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/XalanUTF16Transcoder.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/XalanUTF16Transcoder.cpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/XalanUTF16Transcoder.cpp Wed Nov 19 12:07:05 2008
@@ -28,28 +28,30 @@
 
 
 
-XalanUTF16Transcoder::XalanUTF16Transcoder(MemoryManager& theManager) :
+XalanUTF16Transcoder::XalanUTF16Transcoder(MemoryManager&   theManager) :
     XalanOutputTranscoder(theManager)
 {
 }
 
+
+
 XalanUTF16Transcoder*
 XalanUTF16Transcoder::create(MemoryManager& theManager)
 {
-        typedef XalanUTF16Transcoder ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XalanUTF16Transcoder    ThisType;
 
-        ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        new (theResult) ThisType(theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theManager);
 
-        theGuard.release();
+    theGuard.release();
 
-        return theResult;
+    return theResult;
 }
 
 
+
 XalanUTF16Transcoder::~XalanUTF16Transcoder()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XMLSupport/FormatterToHTML.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XMLSupport/FormatterToHTML.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XMLSupport/FormatterToHTML.cpp (original)
+++ xalan/c/trunk/src/xalanc/XMLSupport/FormatterToHTML.cpp Wed Nov 19 12:07:05 2008
@@ -66,7 +66,7 @@
             int                     indent,
             bool                    escapeURLs,
             bool                    omitMetaTag,
-            MemoryManager&      theManager) :
+            MemoryManager&          theManager) :
     FormatterToXML(
             writer,
             s_emptyString,
@@ -105,7 +105,7 @@
 
 FormatterToHTML*
 FormatterToHTML::create(
-            MemoryManager&      theManager,
+            MemoryManager&          theManager,
             Writer&                 writer,
             const XalanDOMString&   encoding, 
             const XalanDOMString&   mediaType,
@@ -116,25 +116,24 @@
             bool                    escapeURLs,
             bool                    omitMetaTag) 
 {
-    typedef FormatterToHTML ThisType;
+    typedef FormatterToHTML     ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                writer,
+                                encoding, 
+                                mediaType,
+                                doctypeSystem,
+                                doctypePublic,
+                                doIndent,
+                                indent,
+                                escapeURLs,
+                                omitMetaTag,
+                                theManager);
 
-    new (theResult) ThisType(           
-                        writer,
-                        encoding, 
-                        mediaType,
-                        doctypeSystem,
-                        doctypePublic,
-                        doIndent,
-                        indent,
-                        escapeURLs,
-                        omitMetaTag,
-                        theManager);
-
-   theGuard.release();
+    theGuard.release();
 
     return theResult;
 }

Modified: xalan/c/trunk/src/xalanc/XMLSupport/FormatterToText.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XMLSupport/FormatterToText.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XMLSupport/FormatterToText.cpp (original)
+++ xalan/c/trunk/src/xalanc/XMLSupport/FormatterToText.cpp Wed Nov 19 12:07:05 2008
@@ -73,7 +73,7 @@
             const XalanDOMString&   encoding,
             bool                    normalizeLinefeed,
             bool                    handleIgnorableWhitespace,
-            MemoryManager&      theManager ) :
+            MemoryManager&          theManager) :
     FormatterListener(OUTPUT_METHOD_TEXT),
     m_writer(&writer),
     m_maxCharacter(0),
@@ -96,9 +96,11 @@
     update(false);
 }
 
+
+
 FormatterToText*
 FormatterToText::create(
-            MemoryManager&      theManager,
+            MemoryManager&          theManager,
             Writer&                 writer,
             const XalanDOMString&   encoding,
             bool                    normalizeLinefeed,
@@ -106,16 +108,15 @@
 {
     typedef FormatterToText ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(
-                        writer,
-                        encoding,
-                        normalizeLinefeed,
-                        handleIgnorableWhitespace,
-                        theManager); 
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                writer,
+                                encoding, 
+                                normalizeLinefeed,
+                                handleIgnorableWhitespace,
+                                theManager);
 
     theGuard.release();
 
@@ -123,6 +124,7 @@
 }
 
 
+
 FormatterToText::~FormatterToText()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XMLSupport/FormatterToXML.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XMLSupport/FormatterToXML.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XMLSupport/FormatterToXML.cpp (original)
+++ xalan/c/trunk/src/xalanc/XMLSupport/FormatterToXML.cpp Wed Nov 19 12:07:05 2008
@@ -323,48 +323,51 @@
     initCharsMap();
 }
 
+
+
 FormatterToXML*
 FormatterToXML::create(
-                       MemoryManager&      theManager,
+                       MemoryManager&           theManager,
                        Writer&                  writer,
                        const XalanDOMString&    version,
-                       bool                     doIndent ,
-                       int                      indent ,
-                       const XalanDOMString&    encoding ,
-                       const XalanDOMString&    mediaType ,
-                       const XalanDOMString&    doctypeSystem ,
-                       const XalanDOMString&    doctypePublic ,
-                       bool                     xmlDecl ,
-                       const XalanDOMString&    standalone ,
+                       bool                     doIndent,
+                       int                      indent,
+                       const XalanDOMString&    encoding,
+                       const XalanDOMString&    mediaType,
+                       const XalanDOMString&    doctypeSystem,
+                       const XalanDOMString&    doctypePublic,
+                       bool                     xmlDecl,
+                       const XalanDOMString&    standalone,
                        eFormat                  format,
-                       bool                     fBufferData )
+                       bool                     fBufferData)
 {
-    typedef FormatterToXML ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef FormatterToXML  ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(   writer,
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                writer,
                                 version,
-                                doIndent ,
-                                indent ,
-                                encoding ,
-                                mediaType ,
-                                doctypeSystem ,
-                                doctypePublic ,
-                                xmlDecl ,
-                                standalone ,
+                                doIndent,
+                                indent,
+                                encoding,
+                                mediaType,
+                                doctypeSystem,
+                                doctypePublic,
+                                xmlDecl,
+                                standalone,
                                 format,
                                 fBufferData,
                                 theManager);
 
-
     theGuard.release();
 
     return theResult;
 }
 
+
+
 FormatterToXML::~FormatterToXML()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XPath/NameSpace.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/NameSpace.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/NameSpace.hpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/NameSpace.hpp Wed Nov 19 12:07:05 2008
@@ -58,7 +58,7 @@
     NameSpace(
             const XalanDOMString&   prefix,
             const XalanDOMString&   uri,
-            MemoryManager&      theManager) :
+            MemoryManager&          theManager) :
         m_prefix(prefix, theManager),
         m_uri(uri, theManager)
     {
@@ -68,22 +68,26 @@
     create(
             const XalanDOMString&   prefix,
             const XalanDOMString&   uri,
-            MemoryManager&      theManager)
+            MemoryManager&          theManager)
     {
-        typedef NameSpace ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-        
-        ThisType* theResult = theGuard.get();
-        
-        new (theResult) ThisType(prefix, uri, theManager);
-        
+        typedef NameSpace   ThisType;
+
+        XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
+
+        ThisType* const     theResult =
+            new (theGuard.get()) ThisType(
+                                    prefix,
+                                    uri,
+                                    theManager);
+
         theGuard.release();
-        
+
         return theResult;
     }
-    NameSpace( const NameSpace&     other,
-        MemoryManager&      theManager) :
+
+    NameSpace(
+            const NameSpace&    other,
+            MemoryManager&      theManager) :
         m_prefix(other.m_prefix, theManager),
         m_uri(other.m_uri, theManager)        
     {

Modified: xalan/c/trunk/src/xalanc/XPath/XPath.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPath.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPath.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPath.cpp Wed Nov 19 12:07:05 2008
@@ -79,19 +79,22 @@
             MemoryManager&  theManager,
             const Locator*  theLocator)
 {
-    typedef XPath Type;
+    typedef XPath   ThisType;
 
-    XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    Type* theResult = theGuard.get();
-
-    new (theResult) Type(theManager, theLocator);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                theLocator);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XPath::~XPath()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XPath/XPathEvaluator.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathEvaluator.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathEvaluator.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathEvaluator.cpp Wed Nov 19 12:07:05 2008
@@ -69,7 +69,7 @@
 
 XPathEvaluator::XPathEvaluator(MemoryManager& theManager) :
     m_xobjectFactory(theManager, XObjectFactoryDefault::create(theManager)),
-    m_xpathFactory(theManager, XPathFactoryDefault::createXPathFactoryDefault(theManager)),
+    m_xpathFactory(theManager, XPathFactoryDefault::create(theManager)),
     m_constructionContext(theManager, XPathConstructionContextDefault::create(theManager)),
     m_executionContext(theManager, XPathExecutionContextDefault::create(theManager)),
     m_memoryManager(theManager)

Modified: xalan/c/trunk/src/xalanc/XPath/XPathExecutionContextDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathExecutionContextDefault.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathExecutionContextDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathExecutionContextDefault.cpp Wed Nov 19 12:07:05 2008
@@ -109,20 +109,21 @@
 XPathExecutionContextDefault*
 XPathExecutionContextDefault::create(
             MemoryManager&          theManager,
-            XalanNode*             theCurrentNode,
-            const NodeRefListBase* theContextNodeList,
-            const PrefixResolver*  thePrefixResolver)
+            XalanNode*              theCurrentNode,
+            const NodeRefListBase*  theContextNodeList,
+            const PrefixResolver*   thePrefixResolver)
 {
-    typedef XPathExecutionContextDefault ThisType;
+    typedef XPathExecutionContextDefault    ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(   theManager, 
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
                                 theCurrentNode,
                                 theContextNodeList,
                                 thePrefixResolver);
+
     theGuard.release();
 
     return theResult;

Modified: xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.cpp Wed Nov 19 12:07:05 2008
@@ -26,35 +26,37 @@
 
 #include "XPath.hpp"
 
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
 XALAN_CPP_NAMESPACE_BEGIN
 
 
 
-XPathFactoryDefault::XPathFactoryDefault(MemoryManager& theManager) :
+XPathFactoryDefault::XPathFactoryDefault(MemoryManager&     theManager) :
     XPathFactory(),
     m_xpaths(theManager)
 {
 }
 
+
+
 XPathFactoryDefault*
-XPathFactoryDefault::createXPathFactoryDefault(MemoryManager& theManager)
+XPathFactoryDefault::create(MemoryManager&  theManager)
 {
-    typedef XPathFactoryDefault ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XPathFactoryDefault     ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theManager);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XPathFactoryDefault::~XPathFactoryDefault()
 {
     reset();
@@ -90,7 +92,9 @@
     }
     else
     {
-        destroyObjWithMemMgr(theXPath, m_xpaths.getMemoryManager());
+        XalanDestroy(
+            m_xpaths.getMemoryManager(),
+            const_cast<XPath*>(theXPath));
 
         return true;
     }

Modified: xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.hpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathFactoryDefault.hpp Wed Nov 19 12:07:05 2008
@@ -50,7 +50,7 @@
     ~XPathFactoryDefault();
 
     static XPathFactoryDefault*
-    createXPathFactoryDefault(MemoryManager& theManager);
+    create(MemoryManager&   theManager);
 
     // Inherited from XPathFactory...
     virtual void

Modified: xalan/c/trunk/src/xalanc/XPath/XPathFunctionTable.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XPath/XPathFunctionTable.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XPath/XPathFunctionTable.cpp (original)
+++ xalan/c/trunk/src/xalanc/XPath/XPathFunctionTable.cpp Wed Nov 19 12:07:05 2008
@@ -65,13 +65,12 @@
     virtual Function*
     clone(MemoryManager& theManager) const
     {
-        typedef FunctionNotImplemented Type;
+        typedef FunctionNotImplemented  ThisType;
 
-        XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
+        XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        Type* theResult = theGuard.get();
-
-        new (theResult) Type(m_name);
+        ThisType* const     theResult =
+            new (theGuard.get()) ThisType(m_name);
 
         theGuard.release();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemForwardCompatible.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemForwardCompatible.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemForwardCompatible.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemForwardCompatible.cpp Wed Nov 19 12:07:05 2008
@@ -96,18 +96,18 @@
             XalanFileLoc                    lineNumber, 
             XalanFileLoc                    columnNumber)
 {
-    typedef ElemForwardCompatible ThisType;
+    typedef ElemForwardCompatible   ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(constructionContext,
-        stylesheetTree,
-        name,
-        atts,
-        lineNumber,
-        columnNumber);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                constructionContext,
+                                stylesheetTree,
+                                name,
+                                atts,
+                                lineNumber,
+                                columnNumber);
 
     theGuard.release();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemNumber.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemNumber.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemNumber.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemNumber.cpp Wed Nov 19 12:07:05 2008
@@ -179,7 +179,7 @@
 
 ElemNumber*
 ElemNumber::create(
-            MemoryManager&              theManager,
+            MemoryManager&                  theManager,
             StylesheetConstructionContext&  constructionContext,
             Stylesheet&                     stylesheetTree,
             const AttributeListType&        atts,
@@ -187,18 +187,18 @@
             XalanFileLoc                    columnNumber,
             unsigned long                   id)
 {
-    typedef ElemNumber ThisType;
+    typedef ElemNumber  ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(constructionContext,
-        stylesheetTree,
-        atts,
-        lineNumber,
-        columnNumber,
-        id);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                constructionContext,
+                                stylesheetTree,
+                                atts,
+                                lineNumber,
+                                columnNumber,
+                                id);
 
     theGuard.release();
 
@@ -845,7 +845,7 @@
 {
     // Helper to format local specific numbers to strings.
 
-    XalanMemMgrAutoPtr<XalanNumberFormat, true>     formatter(executionContext.createXalanNumberFormat());
+    XalanMemMgrAutoPtr<XalanNumberFormat>   formatter(executionContext.createXalanNumberFormat());
 
     typedef XPathExecutionContext::GetCachedString  GetCachedString;
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ElemSort.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ElemSort.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ElemSort.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ElemSort.cpp Wed Nov 19 12:07:05 2008
@@ -131,17 +131,17 @@
             XalanFileLoc                    lineNumber,
             XalanFileLoc                    columnNumber)
 {
-    typedef ElemSort ThisType;
+    typedef ElemSort    ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(constructionContext,
-        stylesheetTree,
-        atts,
-        lineNumber,
-        columnNumber);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                constructionContext,
+                                stylesheetTree,
+                                atts,
+                                lineNumber,
+                                columnNumber);
 
     theGuard.release();
 

Modified: xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/ExtensionNSHandler.cpp Wed Nov 19 12:07:05 2008
@@ -75,39 +75,46 @@
  * 
  * @param namespaceUri the extension namespace URI that I'm implementing
  */
-ExtensionNSHandler::ExtensionNSHandler(const XalanDOMString&    namespaceUri,
-                                       MemoryManager& theManager) :
+ExtensionNSHandler::ExtensionNSHandler(
+            const XalanDOMString&   namespaceUri,
+            MemoryManager&          theManager) :
     ExtensionFunctionHandler(namespaceUri, theManager),
     m_elements(theManager),
     m_componentDescLoaded(false)
 {
 }
 
-ExtensionNSHandler*
-ExtensionNSHandler::create(const XalanDOMString&    namespaceUri,
-                           MemoryManager&       theManager)
-{
-    typedef ExtensionNSHandler ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(namespaceUri, theManager);
+ExtensionNSHandler*
+ExtensionNSHandler::create(
+            const XalanDOMString&   namespaceUri,
+            MemoryManager&          theManager)
+{
+    typedef ExtensionNSHandler  ThisType;
+
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
+
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                namespaceUri,
+                                theManager);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 ExtensionNSHandler::ExtensionNSHandler (
-            MemoryManager&    theManager,
-            const XalanDOMString& namespaceUri,
-            const XalanDOMString& elemNames,
-            const XalanDOMString& funcNames,
-            const XalanDOMString& lang,
-            const XalanDOMString& srcURL,
-            const XalanDOMString& src) :
+            MemoryManager&          theManager,
+            const XalanDOMString&   namespaceUri,
+            const XalanDOMString&   elemNames,
+            const XalanDOMString&   funcNames,
+            const XalanDOMString&   lang,
+            const XalanDOMString&   srcURL,
+            const XalanDOMString&   src) :
     ExtensionFunctionHandler(theManager, namespaceUri, funcNames, lang, srcURL, src),
     m_elements(theManager),
     m_componentDescLoaded(true)

Modified: xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/KeyTable.cpp Wed Nov 19 12:07:05 2008
@@ -198,28 +198,33 @@
     }   
 } // end constructor
 
+
+
 KeyTable*
-KeyTable::create(MemoryManager& theManager,
+KeyTable::create(
+            MemoryManager&                      theManager,
             XalanNode*                          startNode,
             const PrefixResolver&               resolver,
             const KeyDeclarationVectorType&     keyDeclarations,
             StylesheetExecutionContext&         executionContext)
 {
-    typedef KeyTable ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef KeyTable    ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType( startNode,
-                               resolver,
-                               keyDeclarations,
-                              executionContext);
-   theGuard.release();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                startNode,
+                                resolver,
+                                keyDeclarations,
+                                executionContext);
+    theGuard.release();
 
     return theResult;
 }
 
+
+
 KeyTable::~KeyTable()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/Stylesheet.cpp Wed Nov 19 12:07:05 2008
@@ -30,7 +30,6 @@
 
 
 #include <xalanc/Include/STLHelper.hpp>
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
 
@@ -154,7 +153,7 @@
     
 Stylesheet*
 Stylesheet::create(
-            MemoryManager&              theManager,
+            MemoryManager&                  theManager,
             StylesheetRoot&                 root,
             const XalanDOMString&           baseIdentifier,
             StylesheetConstructionContext&  constructionContext)
@@ -1401,8 +1400,11 @@
             StylesheetConstructionContext&  theConstructionContext,
             const XalanDOMString&           uri)
 {
-    XalanMemMgrAutoPtr<ExtensionNSHandler, true>    theGuard(   theConstructionContext.getMemoryManager(),
-                                                                ExtensionNSHandler::create(uri, theConstructionContext.getMemoryManager()));
+    XalanMemMgrAutoPtr<ExtensionNSHandler>  theGuard(
+                                                theConstructionContext.getMemoryManager(),
+                                                ExtensionNSHandler::create(
+                                                    uri,
+                                                    theConstructionContext.getMemoryManager()));
 
     m_extensionNamespaces.insert(uri, theGuard.get());
 

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetConstructionContextDefault.hpp Wed Nov 19 12:07:05 2008
@@ -444,7 +444,7 @@
 
     XPathFactory&                           m_xpathFactory;
 
-    typedef XalanMemMgrAutoPtr<XPathProcessor, true>    XPathProcessAutoPtr;
+    typedef XalanMemMgrAutoPtr<XPathProcessor>  XPathProcessAutoPtr;
 
     XPathProcessAutoPtr                     m_xpathProcessor;
 

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContext.hpp Wed Nov 19 12:07:05 2008
@@ -1518,7 +1518,7 @@
     };
 #endif
 
-    typedef XalanMemMgrAutoPtr<XalanNumberFormat,true>      XalanNumberFormatAutoPtr;
+    typedef XalanMemMgrAutoPtr<XalanNumberFormat>   XalanNumberFormatAutoPtr;
 
     /**
      * Create a new XalanNumberFormat instance.

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.cpp Wed Nov 19 12:07:05 2008
@@ -162,7 +162,7 @@
 
 
 StylesheetExecutionContextDefault::StylesheetExecutionContextDefault(
-            MemoryManager&      theManager,
+            MemoryManager&          theManager,
             XalanNode*              theCurrentNode,
             const NodeRefListBase*  theContextNodeList,
             const PrefixResolver*   thePrefixResolver) :
@@ -225,29 +225,28 @@
 
 StylesheetExecutionContextDefault*
 StylesheetExecutionContextDefault::create(
-            MemoryManager&      theManager,
+            MemoryManager&          theManager,
             XalanNode*              theCurrentNode,
             const NodeRefListBase*  theContextNodeList,
             const PrefixResolver*   thePrefixResolver)
 {
-    typedef StylesheetExecutionContextDefault ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef StylesheetExecutionContextDefault   ThisType;
 
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(            
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
                                 theManager,
                                 theCurrentNode,
                                 theContextNodeList,
                                 thePrefixResolver);
-
     theGuard.release();
 
     return theResult;
 }
 
 
+
 StylesheetExecutionContextDefault::~StylesheetExecutionContextDefault()
 {
     reset();

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetExecutionContextDefault.hpp Wed Nov 19 12:07:05 2008
@@ -1112,7 +1112,7 @@
      * The factory that will be used to create result tree fragments based on our
      * internal source tree.
      */
-    mutable XalanMemMgrAutoPtr<XalanSourceTreeDocument, true>   m_sourceTreeResultTreeFactory;
+    mutable XalanMemMgrAutoPtr<XalanSourceTreeDocument>     m_sourceTreeResultTreeFactory;
 
     // Holds the current mode.
     const XalanQName*                   m_mode;

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetHandler.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetHandler.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetHandler.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetHandler.cpp Wed Nov 19 12:07:05 2008
@@ -29,7 +29,6 @@
 
 
 #include <xalanc/Include/STLHelper.hpp>
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
 
@@ -1351,7 +1350,8 @@
             
             // This will take care of cleaning up the stylesheet if an exception
             // is thrown.
-            typedef XalanMemMgrAutoPtr<Stylesheet, true> AutpPtr;
+            typedef XalanMemMgrAutoPtr<Stylesheet>  AutpPtr;
+
             AutpPtr importedStylesheet( 
                 m_constructionContext.getMemoryManager(),
                 m_constructionContext.create(

Modified: xalan/c/trunk/src/xalanc/XSLT/StylesheetRoot.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/StylesheetRoot.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/StylesheetRoot.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/StylesheetRoot.cpp Wed Nov 19 12:07:05 2008
@@ -115,25 +115,29 @@
 }               
 
 
+
 StylesheetRoot*
 StylesheetRoot::create(
-                           MemoryManager&              theManager,
-                           const XalanDOMString&            baseIdentifier,
-                           StylesheetConstructionContext&   constructionContext)
-{
-    typedef StylesheetRoot ThisType;
-
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+            MemoryManager&                   theManager,
+            const XalanDOMString&            baseIdentifier,
+            StylesheetConstructionContext&   constructionContext)
+{
+    typedef StylesheetRoot  ThisType;
+
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
+
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                baseIdentifier,
+                                constructionContext);
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(baseIdentifier, constructionContext);
-                             
     theGuard.release();
 
     return theResult;
 }
 
+
+
 StylesheetRoot::~StylesheetRoot()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XSLT/TopLevelArg.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/TopLevelArg.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/TopLevelArg.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/TopLevelArg.cpp Wed Nov 19 12:07:05 2008
@@ -25,56 +25,67 @@
 
 
 TopLevelArg::TopLevelArg(
-        MemoryManager&      theManager,
-        const XalanQName&       name,
-        const XalanDOMString&   expr) :
+            MemoryManager&          theManager,
+            const XalanQName&       name,
+            const XalanDOMString&   expr) :
     m_qname(name, theManager),
     m_expression(expr, theManager),
     m_xobject(0)
 {
 }
+
+
+
 TopLevelArg*
 TopLevelArg::create(
-        MemoryManager&      theManager,
-        const XalanQName&       name,
-        const XalanDOMString&   expr)
+            MemoryManager&          theManager,
+            const XalanQName&       name,
+            const XalanDOMString&   expr)
 {
     typedef TopLevelArg ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
-
-    new (theResult) ThisType(theManager, name, expr);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                name,
+                                expr);
 
     theGuard.release();
 
     return theResult;
 }
 
+
+
 TopLevelArg::TopLevelArg(
-        MemoryManager&  theManager,
-        const XalanQName&   name,
-        const XObjectPtr    variable) :
+            MemoryManager&      theManager,
+            const XalanQName&   name,
+            const XObjectPtr    variable) :
     m_qname(name, theManager),
     m_expression(theManager),
     m_xobject(variable)
 {
 }
 
+
+
 TopLevelArg*
 TopLevelArg::create(
-        MemoryManager&      theManager,
-        const XalanQName&       name,
-        const XObjectPtr        variable)
+            MemoryManager&      theManager,
+            const XalanQName&   name,
+            const XObjectPtr    variable)
 {
     typedef TopLevelArg ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theManager, name, variable);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                name,
+                                variable);
 
     theGuard.release();
 
@@ -82,8 +93,10 @@
 }
 
 
-TopLevelArg::TopLevelArg(const TopLevelArg&     theSource,
-                         MemoryManager&     theManager) :
+
+TopLevelArg::TopLevelArg(
+            const TopLevelArg&  theSource,
+            MemoryManager&      theManager) :
     m_qname(theSource.m_qname, theManager),
     m_expression(theSource.m_expression, theManager),
     m_xobject(theSource.m_xobject)

Modified: xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.cpp Wed Nov 19 12:07:05 2008
@@ -838,7 +838,7 @@
             }
         }
 
-        if(nl.getLength() == 0)
+        if (nl.getLength() == 0)
         {
             const CCGetCachedString     theGuard(constructionContext);
 
@@ -853,11 +853,11 @@
 
         XalanNode* const    frag = nl.item(0);
 
-        if(XalanNode::ELEMENT_NODE == frag->getNodeType())
+        if (XalanNode::ELEMENT_NODE == frag->getNodeType())
         {
-            XalanMemMgrAutoPtr<Stylesheet, true>    theGuard;
+            XalanMemMgrAutoPtr<Stylesheet>  theGuard;
 
-            if(isRoot)
+            if (isRoot)
             {
                 StylesheetRoot* const   theLocalRoot =
                     constructionContext.create(stringHolder);
@@ -902,7 +902,7 @@
     }
     else
     {
-        XalanMemMgrAutoPtr<Stylesheet, true>    theGuard;
+        XalanMemMgrAutoPtr<Stylesheet>  theGuard;
 
         const XalanDocument* const  theOwnerDocument =
                 fragBase.getNodeType() == XalanNode::DOCUMENT_NODE ?

Modified: xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/XSLTEngineImpl.hpp Wed Nov 19 12:07:05 2008
@@ -177,13 +177,13 @@
         const XalanDOMString&   m_string;
     };
 
-    typedef XalanMemMgrAutoPtr<XPathProcessor, true>                XPathProcessorPtrType;
-    typedef Function::XObjectArgVectorType              XObjectArgVectorType;
-    typedef StylesheetExecutionContext::ParamVectorType ParamVectorType;
-    typedef XPathConstructionContext::GetCachedString   CCGetCachedString;
-    typedef XPathExecutionContext::GetCachedString      ECGetCachedString;
+    typedef XalanMemMgrAutoPtr<XPathProcessor>              XPathProcessorPtrType;
+    typedef Function::XObjectArgVectorType                  XObjectArgVectorType;
+    typedef StylesheetExecutionContext::ParamVectorType     ParamVectorType;
+    typedef XPathConstructionContext::GetCachedString       CCGetCachedString;
+    typedef XPathExecutionContext::GetCachedString          ECGetCachedString;
 
-    typedef XalanMap<XalanDOMString, XalanParamHolder>  ParamMapType;
+    typedef XalanMap<XalanDOMString, XalanParamHolder>      ParamMapType;
 
     // Public members
     //---------------------------------------------------------------------

Modified: xalan/c/trunk/src/xalanc/XSLT/XSLTInit.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/XSLTInit.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/XSLTInit.cpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/XSLTInit.cpp Wed Nov 19 12:07:05 2008
@@ -50,23 +50,25 @@
     }
 }
 
+
+
 XSLTInit*
 XSLTInit::create(MemoryManager&      theManager)
 {
-        typedef XSLTInit ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XSLTInit    ThisType;
 
-        ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        new (theResult) ThisType(theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theManager);
 
-        theGuard.release();
+    theGuard.release();
 
-        return theResult;
+    return theResult;
 }
 
 
+
 XSLTInit::~XSLTInit()
 {
     --s_initCounter;
@@ -77,14 +79,18 @@
     }
 }
 
+
+
 MemoryManager&
 XSLTInit::getMemoryManager()
 {
-    assert( s_staticMemoryManager !=0);
+    assert(s_staticMemoryManager != 0);
 
     return *s_staticMemoryManager;
 }
 
+
+
 void
 XSLTInit::initialize(MemoryManager&  theManager)
 {
@@ -96,7 +102,7 @@
 
     StylesheetHandler::initialize(theManager);
 
-    s_staticMemoryManager = & theManager;
+    s_staticMemoryManager = &theManager;
 
 }
 
@@ -114,7 +120,6 @@
     Constants::terminate();
 
     s_staticMemoryManager = 0;
-
 }
 
 

Modified: xalan/c/trunk/src/xalanc/XSLT/XSLTInit.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XSLT/XSLTInit.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XSLT/XSLTInit.hpp (original)
+++ xalan/c/trunk/src/xalanc/XSLT/XSLTInit.hpp Wed Nov 19 12:07:05 2008
@@ -54,7 +54,6 @@
 {
 public:
 
-    explicit
     XSLTInit(MemoryManager&      theManager);
 
     ~XSLTInit();
@@ -62,10 +61,9 @@
     static XSLTInit*
     create(MemoryManager&      theManager);
 
-    inline MemoryManager&
+    MemoryManager&
     getMemoryManager();
 
-
 private:
 
     // Not implemented...

Modified: xalan/c/trunk/src/xalanc/XalanDOM/XalanDOMString.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanDOM/XalanDOMString.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanDOM/XalanDOMString.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanDOM/XalanDOMString.cpp Wed Nov 19 12:07:05 2008
@@ -101,7 +101,7 @@
 XalanDOMString*
 XalanDOMString::clone(MemoryManager&  theManager)
 {
-    typedef XalanDOMString ThisType;
+    typedef XalanDOMString  ThisType;
 
     XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 

Modified: xalan/c/trunk/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp (original)
+++ xalan/c/trunk/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp Wed Nov 19 12:07:05 2008
@@ -153,15 +153,14 @@
 #endif
     clone(MemoryManager& theManager) const
     {
-        typedef  XalanEXSLTFunctionObjectType Type;
+        typedef XalanEXSLTFunctionObjectType    ThisType;
 
-        XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
+        XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        Type* theResult = theGuard.get();
+        ThisType* const     theResult =
+            new (theGuard.get()) ThisType(theManager);
 
-        new (theResult) Type(theManager);
-
-         theGuard.release();
+        theGuard.release();
 
         return theResult;
     }

Modified: xalan/c/trunk/src/xalanc/XalanExtensions/FunctionDistinct.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanExtensions/FunctionDistinct.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanExtensions/FunctionDistinct.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanExtensions/FunctionDistinct.cpp Wed Nov 19 12:07:05 2008
@@ -21,7 +21,6 @@
 
 #include <xalanc/Include/XalanSet.hpp>
 
-#include <xalanc/Include/XalanMemMgrHelper.hpp>
 
 
 #include <xalanc/XalanDOM/XalanDOMString.hpp>

Modified: xalan/c/trunk/src/xalanc/XalanSourceTree/XalanSourceTreeDocument.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanSourceTree/XalanSourceTreeDocument.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanSourceTree/XalanSourceTreeDocument.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanSourceTree/XalanSourceTreeDocument.cpp Wed Nov 19 12:07:05 2008
@@ -54,7 +54,7 @@
 
 
 XalanSourceTreeDocument::XalanSourceTreeDocument(
-            MemoryManager&  theManager,
+            MemoryManager&      theManager,
             bool                fPoolAllText,
             block_size_type     theNamesStringPoolBlockSize,
             bucket_count_type   theNamesStringPoolBucketCount,
@@ -87,36 +87,41 @@
 {
 }
 
+
+
 XalanSourceTreeDocument*
 XalanSourceTreeDocument::create( 
-            MemoryManager&  theManager,
+            MemoryManager&      theManager,
             bool                fPoolAllText,
-            block_size_type     theNamesStringPoolBlockSize ,
+            block_size_type     theNamesStringPoolBlockSize,
             bucket_count_type   theNamesStringPoolBucketCount,
             bucket_size_type    theNamesStringPoolBucketSize,
             block_size_type     theValuesStringPoolBlockSize,
             bucket_count_type   theValuesStringPoolBucketCount,
             bucket_size_type    theValuesStringPoolBucketSize)
 {
-        typedef XalanSourceTreeDocument ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-        ThisType* theResult = theGuard.get();
-
-        new (theResult) ThisType(theManager,
-                                 fPoolAllText,
-                                 theNamesStringPoolBlockSize,
-                                 theNamesStringPoolBucketCount,
-                                 theNamesStringPoolBucketSize,
-                                 theValuesStringPoolBlockSize,
-                                 theValuesStringPoolBucketCount,
-                                 theValuesStringPoolBucketSize); 
-        theGuard.release();
+    typedef XalanSourceTreeDocument     ThisType;
 
-        return theResult;
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
+
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                fPoolAllText,
+                                theNamesStringPoolBlockSize,
+                                theNamesStringPoolBucketCount,
+                                theNamesStringPoolBucketSize,
+                                theValuesStringPoolBlockSize,
+                                theValuesStringPoolBucketCount,
+                                theValuesStringPoolBucketSize);
+
+    theGuard.release();
+
+    return theResult;
 }
 
+
+
 XalanSourceTreeDocument::XalanSourceTreeDocument(
             MemoryManager&      theManager,
             allocator_size_type     theAttributeBlockSize,

Modified: xalan/c/trunk/src/xalanc/XalanTransformer/XalanCAPI.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanTransformer/XalanCAPI.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanTransformer/XalanCAPI.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanTransformer/XalanCAPI.cpp Wed Nov 19 12:07:05 2008
@@ -35,11 +35,14 @@
 #include "XalanCAPI.h"
 #include "XalanTransformer.hpp"
 
-#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
+
+
+#include "xalanc/Include/XalanMemoryManagement.hpp"
 
 
 XALAN_USING_STD(istrstream)
 
+XALAN_USING_XALAN(XalanAllocationGuard)
 XALAN_USING_XALAN(XalanCompiledStylesheet)
 XALAN_USING_XALAN(XalanDOMString)
 XALAN_USING_XALAN(XalanParsedSource)
@@ -106,16 +109,14 @@
     // Create a XalanTransformer object.
     typedef XalanTransformer ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
-
-    ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    new (theResult) ThisType(theManager);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(theManager);
 
-     theGuard.release();
-
-    return (XalanHandle)theResult;
+    theGuard.release();
 
+    return theResult;
 }
 
 

Modified: xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultDocumentBuilder.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultDocumentBuilder.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultDocumentBuilder.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultDocumentBuilder.cpp Wed Nov 19 12:07:05 2008
@@ -42,22 +42,29 @@
     m_domSupport.setParserLiaison(&m_parserLiaison);
 }
 
+
+
 XalanDefaultDocumentBuilder*
-XalanDefaultDocumentBuilder::create(MemoryManager& theManager, const XalanDOMString&    theURI)
+XalanDefaultDocumentBuilder::create(
+            MemoryManager&          theManager,
+            const XalanDOMString&   theURI)
 {
-        typedef XalanDefaultDocumentBuilder ThisType;
-        
-        XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    typedef XalanDefaultDocumentBuilder     ThisType;
 
-        ThisType* theResult = theGuard.get();
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-        new (theResult) ThisType(theManager, theURI);
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theManager,
+                                theURI);
 
-         theGuard.release();
+    theGuard.release();
 
-        return theResult;
+    return theResult;
 }
 
+
+
 XalanDefaultDocumentBuilder::~XalanDefaultDocumentBuilder()
 {
 }

Modified: xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultParsedSource.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultParsedSource.cpp?rev=719046&r1=719045&r2=719046&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultParsedSource.cpp (original)
+++ xalan/c/trunk/src/xalanc/XalanTransformer/XalanDefaultParsedSource.cpp Wed Nov 19 12:07:05 2008
@@ -104,30 +104,37 @@
 
 
 
-XalanDefaultParsedSourceHelper::XalanDefaultParsedSourceHelper(const XalanSourceTreeDOMSupport&     theSourceDOMSupport,
-                                                               MemoryManager&                   theManager) :
+XalanDefaultParsedSourceHelper::XalanDefaultParsedSourceHelper(
+            const XalanSourceTreeDOMSupport&    theSourceDOMSupport,
+            MemoryManager&                      theManager) :
     m_parserLiaison(theManager),
     m_domSupport(m_parserLiaison, theSourceDOMSupport)
 {
 }
 
+
+
 XalanDefaultParsedSourceHelper*
-XalanDefaultParsedSourceHelper::create(const XalanSourceTreeDOMSupport&     theSourceDOMSupport,
-                                       MemoryManager&                   theManager)
+XalanDefaultParsedSourceHelper::create(
+            const XalanSourceTreeDOMSupport&    theSourceDOMSupport,
+            MemoryManager&                      theManager)
 {
-    typedef XalanDefaultParsedSourceHelper ThisType;
+    typedef XalanDefaultParsedSourceHelper  ThisType;
 
-    XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
+    XalanAllocationGuard    theGuard(theManager, theManager.allocate(sizeof(ThisType)));
 
-    ThisType* theResult = theGuard.get();
+    ThisType* const     theResult =
+        new (theGuard.get()) ThisType(
+                                theSourceDOMSupport,
+                                theManager);
 
-    new (theResult) ThisType(theSourceDOMSupport, theManager);
-                             
     theGuard.release();
 
     return theResult;
 }
 
+
+
 XalanDefaultParsedSourceHelper::~XalanDefaultParsedSourceHelper()
 {
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message