Author: dbertoni
Date: Tue Jul 15 09:29:19 2008
New Revision: 676954

URL: http://svn.apache.org/viewvc?rev=676954&view=rev
Log:
Merge of branch that fixes some MemoryManager issues with the transcoding 
subsystem.

Modified:
    xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
    xerces/c/trunk/src/xercesc/util/TransService.cpp
    xerces/c/trunk/src/xercesc/util/TransService.hpp
    xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
    xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
    xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
    xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp
    
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
    
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
    
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
    
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
    xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
    xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp

Modified: xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp Tue Jul 15 09:29:19 2008
@@ -253,7 +253,7 @@
     //  that will be used internally by the XMLString class. If we cannot
     //  create one, then call the panic method.
     //
-    XMLLCPTranscoder* defXCode = 
XMLPlatformUtils::fgTransService->makeNewLCPTranscoder();
+    XMLLCPTranscoder* defXCode = 
XMLPlatformUtils::fgTransService->makeNewLCPTranscoder(fgMemoryManager);
     if (!defXCode)
         panic(PanicHandler::Panic_NoDefTranscoder);
     XMLString::initString(defXCode, fgMemoryManager);
@@ -433,15 +433,15 @@
        XMLTransService* tc = 0;
 
        #if defined   (XERCES_USE_TRANSCODER_ICU)
-               tc = new ICUTransService;
+               tc = new ICUTransService(fgMemoryManager);
        #elif defined (XERCES_USE_TRANSCODER_GNUICONV)
-               tc = new IconvGNUTransService;
+               tc = new IconvGNUTransService(fgMemoryManager);
        #elif defined (XERCES_USE_TRANSCODER_ICONV)
-               tc = new IconvTransService;
+               tc = new IconvTransService(fgMemoryManager);
        #elif defined (XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER)
-               tc = new MacOSUnicodeConverter;
+               tc = new MacOSUnicodeConverter(fgMemoryManager);
        #elif defined (XERCES_USE_TRANSCODER_WINDOWS)
-               tc = new Win32TransService;
+               tc = new Win32TransService(fgMemoryManager);
        #else
                #error No Transcoder configured for platform! You must 
configure it.
        #endif

Modified: xerces/c/trunk/src/xercesc/util/TransService.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/TransService.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/TransService.cpp (original)
+++ xerces/c/trunk/src/xercesc/util/TransService.cpp Tue Jul 15 09:29:19 2008
@@ -22,6 +22,7 @@
 //  Includes
 // ---------------------------------------------------------------------------
 #include <xercesc/util/Janitor.hpp>
+#include <xercesc/util/TransService.hpp>
 #include <xercesc/util/XML88591Transcoder.hpp>
 #include <xercesc/util/XMLASCIITranscoder.hpp>
 #include <xercesc/util/XMLChTranscoder.hpp>

Modified: xerces/c/trunk/src/xercesc/util/TransService.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/TransService.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/TransService.hpp (original)
+++ xerces/c/trunk/src/xercesc/util/TransService.hpp Tue Jul 15 09:29:19 2008
@@ -121,7 +121,12 @@
 
     virtual const XMLCh* getId() const = 0;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder() = 0;
+    // -----------------------------------------------------------------------
+    // Create a new transcoder for the local code page.
+    //
+    //  @param manager The memory manager to use.
+    // -----------------------------------------------------------------------
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager) = 0;
 
     virtual bool supportsSrcOfs() const = 0;
 

Modified: xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp Tue Jul 
15 09:29:19 2008
@@ -136,7 +136,7 @@
 // ---------------------------------------------------------------------------
 //  ICUTransService: Constructors and Destructor
 // ---------------------------------------------------------------------------
-ICUTransService::ICUTransService()
+ICUTransService::ICUTransService(MemoryManager* manager)
 {
 #if (U_ICU_VERSION_MAJOR_NUM > 2 || (U_ICU_VERSION_MAJOR_NUM == 2 && 
U_ICU_VERSION_MINOR_NUM >= 6))
     UErrorCode errorCode=U_ZERO_ERROR;
@@ -281,7 +281,7 @@
     return gMyServiceId;
 }
 
-XMLLCPTranscoder* ICUTransService::makeNewLCPTranscoder()
+XMLLCPTranscoder* ICUTransService::makeNewLCPTranscoder(MemoryManager* manager)
 {
     //
     //  Try to create a default converter. If it fails, return a null
@@ -294,7 +294,7 @@
         return 0;
 
     // That went ok, so create an ICU LCP transcoder wrapper and return it
-    return new ICULCPTranscoder(converter);
+    return new (manager) ICULCPTranscoder(converter);
 }
 
 

Modified: xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp Tue Jul 
15 09:29:19 2008
@@ -36,7 +36,7 @@
     // -----------------------------------------------------------------------
     //  Constructors and Destructor
     // -----------------------------------------------------------------------
-    ICUTransService();
+    ICUTransService(MemoryManager* manager);
     ~ICUTransService();
 
 
@@ -58,7 +58,7 @@
 
     virtual const XMLCh* getId() const;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager);
 
     virtual bool supportsSrcOfs() const;
 

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp Tue 
Jul 15 09:29:19 2008
@@ -89,7 +89,7 @@
 // ---------------------------------------------------------------------------
 //  IconvTransService: Constructors and Destructor
 // ---------------------------------------------------------------------------
-IconvTransService::IconvTransService()
+IconvTransService::IconvTransService(MemoryManager* /* manager */)
 {
 }
 
@@ -161,10 +161,10 @@
     return gMyServiceId;
 }
 
-XMLLCPTranscoder* IconvTransService::makeNewLCPTranscoder()
+XMLLCPTranscoder* IconvTransService::makeNewLCPTranscoder(MemoryManager* 
manager)
 {
     // Just allocate a new transcoder of our type
-    return new IconvLCPTranscoder;
+    return new (manager) IconvLCPTranscoder;
 }
 
 bool IconvTransService::supportsSrcOfs() const

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp Tue 
Jul 15 09:29:19 2008
@@ -32,7 +32,7 @@
     // -----------------------------------------------------------------------
     //  Constructors and Destructor
     // -----------------------------------------------------------------------
-    IconvTransService();
+    IconvTransService(MemoryManager* manager);
     ~IconvTransService();
 
 
@@ -54,7 +54,7 @@
 
     virtual const XMLCh* getId() const;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager);
 
     virtual bool supportsSrcOfs() const;
 

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp 
(original)
+++ 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp 
Tue Jul 15 09:29:19 2008
@@ -161,18 +161,19 @@
 // ports collection). The following is a wrapper around the iconv().
 //----------------------------------------------------------------------------
 
-IconvGNUWrapper::IconvGNUWrapper ()
+IconvGNUWrapper::IconvGNUWrapper (MemoryManager* manager)
     : fUChSize(0), fUBO(LITTLE_ENDIAN),
-      fCDTo((iconv_t)-1), fCDFrom((iconv_t)-1)
+      fCDTo((iconv_t)-1), fCDFrom((iconv_t)-1), fMutex(manager)
 {
 }
 
 IconvGNUWrapper::IconvGNUWrapper ( iconv_t    cd_from,
                iconv_t    cd_to,
                size_t    uchsize,
-               unsigned int    ubo )
+               unsigned int    ubo,
+               MemoryManager* manager)
     : fUChSize(uchsize), fUBO(ubo),
-      fCDTo(cd_to), fCDFrom(cd_from)
+      fCDTo(cd_to), fCDFrom(cd_from), fMutex(manager)
 {
     if (fCDFrom == (iconv_t) -1 || fCDTo == (iconv_t) -1) {
         XMLPlatformUtils::panic (PanicHandler::Panic_NoTransService);
@@ -383,8 +384,8 @@
 //  IconvGNUTransService: Constructors and Destructor
 // ---------------------------------------------------------------------------
 
-IconvGNUTransService::IconvGNUTransService()
-    : IconvGNUWrapper(), fUnicodeCP(0)
+IconvGNUTransService::IconvGNUTransService(MemoryManager* manager)
+    : IconvGNUWrapper(manager), fUnicodeCP(0)
 {
     // Try to obtain local (host) characterset from the setlocale
     // and through the environment. Do not call setlocale(LC_*, "")!
@@ -546,9 +547,9 @@
     return gMyServiceId;
 }
 
-XMLLCPTranscoder* IconvGNUTransService::makeNewLCPTranscoder()
+XMLLCPTranscoder* IconvGNUTransService::makeNewLCPTranscoder(MemoryManager* 
manager)
 {
-    return new IconvGNULCPTranscoder (cdFrom(), cdTo(), uChSize(), UBO());
+    return new (manager) IconvGNULCPTranscoder (cdFrom(), cdTo(), uChSize(), 
UBO(), manager);
 }
 
 bool IconvGNUTransService::supportsSrcOfs() const
@@ -942,8 +943,9 @@
 IconvGNULCPTranscoder::IconvGNULCPTranscoder (iconv_t        cd_from,
                         iconv_t        cd_to,
                         size_t        uchsize,
-                        unsigned int    ubo)
-    : IconvGNUWrapper (cd_from, cd_to, uchsize, ubo)
+                        unsigned int    ubo,
+                        MemoryManager* manager)
+    : IconvGNUWrapper (cd_from, cd_to, uchsize, ubo, manager)
 {
 }
 
@@ -965,7 +967,7 @@
                       , MemoryManager* const manager
     )
     : XMLTranscoder(encodingName, blockSize, manager)
-    , IconvGNUWrapper (cd_from, cd_to, uchsize, ubo)
+    , IconvGNUWrapper (cd_from, cd_to, uchsize, ubo, manager)
 {
 }
 
@@ -1115,3 +1117,4 @@
 
 XERCES_CPP_NAMESPACE_END
 
+

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp 
(original)
+++ 
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp 
Tue Jul 15 09:29:19 2008
@@ -44,7 +44,8 @@
       iconv_t          cd_from,
       iconv_t          cd_to,
       size_t           uchsize,
-      unsigned int     ubo
+      unsigned int     ubo,
+      MemoryManager* manager
     );
     virtual ~IconvGNUWrapper();
 
@@ -109,8 +110,8 @@
 
 protected:
 
-    // Hidden default constructor
-    IconvGNUWrapper();
+    // Hidden constructor
+    IconvGNUWrapper(MemoryManager* manager);
 
     // Private data accessors
     inline void        setCDTo (iconv_t cd) { fCDTo = cd; }
@@ -158,7 +159,7 @@
     // -----------------------------------------------------------------------
     //  Constructors and Destructor
     // -----------------------------------------------------------------------
-    IconvGNUTransService();
+    IconvGNUTransService(MemoryManager* manager);
     ~IconvGNUTransService();
 
 
@@ -180,7 +181,7 @@
 
     virtual const XMLCh* getId() const;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager);
 
     virtual bool supportsSrcOfs() const;
 
@@ -295,7 +296,8 @@
       iconv_t          from,
       iconv_t          to,
       size_t           uchsize,
-      unsigned int     ubo
+      unsigned int     ubo,
+      MemoryManager* manager
     );
 
 protected:
@@ -354,3 +356,4 @@
 
 #endif /* ICONVGNUTRANSSERVICE */
 
+

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
 (original)
+++ 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
 Tue Jul 15 09:29:19 2008
@@ -88,7 +88,7 @@
 // ---------------------------------------------------------------------------
 //  MacOSUnicodeConverter: Constructors and Destructor
 // ---------------------------------------------------------------------------
-MacOSUnicodeConverter::MacOSUnicodeConverter()
+MacOSUnicodeConverter::MacOSUnicodeConverter(MemoryManager* manager)
   : fCollator(NULL)
 {
        //      Test for presense of unicode collation functions
@@ -255,11 +255,10 @@
 }
 
 
-XMLLCPTranscoder* MacOSUnicodeConverter::makeNewLCPTranscoder()
+XMLLCPTranscoder* MacOSUnicodeConverter::makeNewLCPTranscoder(MemoryManager* 
manager)
 {
        XMLLCPTranscoder* result = NULL;
        OSStatus status = noErr;
-    MemoryManager* manager = XMLPlatformUtils::fgMemoryManager;
        
        //  Discover the text encoding to use for the LCP
        TextEncoding lcpTextEncoding = discoverLCPEncoding();
@@ -275,7 +274,7 @@
     {
         //  Pass the XMLTranscoder over to the LPC transcoder
         if (resValue == XMLTransService::Ok)
-            result = new MacOSLCPTranscoder(xmlTrans, manager);
+            result = new (manager) MacOSLCPTranscoder(xmlTrans, manager);
         else
             delete xmlTrans;
     }

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
 (original)
+++ 
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
 Tue Jul 15 09:29:19 2008
@@ -68,7 +68,7 @@
 
     virtual const XMLCh* getId() const;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager);
 
     virtual bool supportsSrcOfs() const;
 
@@ -79,7 +79,7 @@
     // -----------------------------------------------------------------------
     //  Hidden constructors
     // -----------------------------------------------------------------------
-    MacOSUnicodeConverter();
+    MacOSUnicodeConverter(MemoryManager* manager);
 
     // -----------------------------------------------------------------------
     //  Protected virtual methods

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp Tue 
Jul 15 09:29:19 2008
@@ -165,12 +165,14 @@
     (
         const   XMLCh* const    encodingName
         , const unsigned int    ieId
+        , MemoryManager*        manager
     );
 
     CPMapEntry
     (
         const   char* const     encodingName
         , const unsigned int    ieId
+        , MemoryManager*        manager
     );
 
     ~CPMapEntry();
@@ -205,21 +207,24 @@
     // -----------------------------------------------------------------------
     XMLCh*          fEncodingName;
     unsigned int    fIEId;
+    MemoryManager*  fManager;
 };
 
 // ---------------------------------------------------------------------------
 //  CPMapEntry: Constructors and Destructor
 // ---------------------------------------------------------------------------
 CPMapEntry::CPMapEntry( const   char* const     encodingName
-                        , const unsigned int    ieId) :
+                        , const unsigned int    ieId
+                        , MemoryManager*        manager) :
     fEncodingName(0)
     , fIEId(ieId)
+    , fManager(manager)
 {
     // Transcode the name to Unicode and store that copy
     int targetLen=::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, encodingName, 
-1, NULL, 0);
     if(targetLen!=0)
     {
-        fEncodingName = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
+        fEncodingName = (XMLCh*) fManager->allocate
         (
             (targetLen + 1) * sizeof(XMLCh)
         );//new XMLCh[targetLen + 1];
@@ -235,12 +240,14 @@
 }
 
 CPMapEntry::CPMapEntry( const   XMLCh* const    encodingName
-                        , const unsigned int    ieId) :
+                        , const unsigned int    ieId
+                        , MemoryManager*        manager) :
 
     fEncodingName(0)
     , fIEId(ieId)
+    , fManager(manager)
 {
-    fEncodingName = XMLString::replicate(encodingName, 
XMLPlatformUtils::fgMemoryManager);
+    fEncodingName = XMLString::replicate(encodingName, fManager);
 
     //
     //  Upper case it because we are using a hash table and need to be
@@ -251,7 +258,7 @@
 
 CPMapEntry::~CPMapEntry()
 {
-    XMLPlatformUtils::fgMemoryManager->deallocate(fEncodingName);//delete [] 
fEncodingName;
+    fManager->deallocate(fEncodingName);//delete [] fEncodingName;
 }
 
 
@@ -282,7 +289,9 @@
 // ---------------------------------------------------------------------------
 //  Win32TransService: Constructors and Destructor
 // ---------------------------------------------------------------------------
-Win32TransService::Win32TransService()
+Win32TransService::Win32TransService(MemoryManager* manager) :
+    fCPMap(NULL)
+    , fManager(manager)
 {
     // Figure out if we are on XP or later and save that flag for later use.
     // We need this because of certain code page conversion calls.
@@ -409,7 +418,7 @@
                     continue;
                 }
 
-                CPMapEntry* newEntry = new CPMapEntry(nameBuf, IEId);
+                CPMapEntry* newEntry = new (fManager) CPMapEntry(nameBuf, 
IEId, fManager);
                 fCPMap->put((void*)newEntry->getEncodingName(), newEntry);
             }
         }
@@ -463,7 +472,7 @@
             int targetLen = ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, 
aliasBuf, -1, NULL, 0);
             if(targetLen!=0)
             {
-                XMLCh* uniAlias = (XMLCh*) 
XMLPlatformUtils::fgMemoryManager->allocate
+                XMLCh* uniAlias = (XMLCh*) fManager->allocate
                 (
                     (targetLen + 1) * sizeof(XMLCh)
                 );//new XMLCh[targetLen + 1];
@@ -478,7 +487,7 @@
                     int targetLen = ::MultiByteToWideChar(CP_ACP, 
MB_PRECOMPOSED, nameBuf, -1, NULL, 0);
                     if(targetLen!=0)
                     {
-                        XMLCh* uniName = (XMLCh*) 
XMLPlatformUtils::fgMemoryManager->allocate
+                        XMLCh* uniName = (XMLCh*) fManager->allocate
                         (
                             (targetLen + 1) * sizeof(XMLCh)
                         );//new XMLCh[targetLen + 1];
@@ -493,14 +502,14 @@
                         //
                                                if (!XMLString::equals(uniName, 
aliasedEntry->getEncodingName()))
                         {
-                            CPMapEntry* newEntry = new CPMapEntry(uniName, 
aliasedEntry->getIEEncoding());
+                            CPMapEntry* newEntry = new (fManager) 
CPMapEntry(uniName, aliasedEntry->getIEEncoding(), fManager);
                             fCPMap->put((void*)newEntry->getEncodingName(), 
newEntry);
                         }
 
-                        
XMLPlatformUtils::fgMemoryManager->deallocate(uniName);//delete [] uniName;
+                        fManager->deallocate(uniName);//delete [] uniName;
                     }
                 }
-                
XMLPlatformUtils::fgMemoryManager->deallocate(uniAlias);//delete [] uniAlias;
+                fManager->deallocate(uniAlias);//delete [] uniAlias;
             }
         }
 
@@ -541,10 +550,10 @@
     return gMyServiceId;
 }
 
-XMLLCPTranscoder* Win32TransService::makeNewLCPTranscoder()
+XMLLCPTranscoder* Win32TransService::makeNewLCPTranscoder(MemoryManager* 
manager)
 {
     // Just allocate a new LCP transcoder of our type
-    return new Win32LCPTranscoder;
+    return new (manager) Win32LCPTranscoder;
 }
 
 

Modified: 
xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
URL: 
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp?rev=676954&r1=676953&r2=676954&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp 
(original)
+++ xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp Tue 
Jul 15 09:29:19 2008
@@ -43,7 +43,7 @@
     // -----------------------------------------------------------------------
     //  Constructors and Destructor
     // -----------------------------------------------------------------------
-    Win32TransService();
+    Win32TransService(MemoryManager* manager);
     virtual ~Win32TransService();
 
 
@@ -65,7 +65,7 @@
 
     virtual const XMLCh* getId() const;
 
-    virtual XMLLCPTranscoder* makeNewLCPTranscoder();
+    virtual XMLLCPTranscoder* makeNewLCPTranscoder(MemoryManager* manager);
 
     virtual bool supportsSrcOfs() const;
 
@@ -102,6 +102,7 @@
     //      which is cool since it will be read only once its initialized.
 
     RefHashTableOf<CPMapEntry>    *fCPMap;
+    MemoryManager*  fManager;
 };
 
 
@@ -267,6 +268,8 @@
     // -----------------------------------------------------------------------
     Win32LCPTranscoder(const Win32LCPTranscoder&);
     Win32LCPTranscoder& operator=(const Win32LCPTranscoder&);
+
+    MemoryManager*  fManager;
 };
 
 XERCES_CPP_NAMESPACE_END



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to