jberry 2003/08/27 09:41:56 Modified: c/src/xercesc/util PlatformUtils.cpp PlatformUtils.hpp c/src/xercesc/util/Platforms/MacOS MacOSPlatformUtils.hpp c/src/xercesc/util/Transcoders/MacOSUnicodeConverter MacOSUnicodeConverter.cpp Log: Add new static global that always points to array-allocating memory manager Revision Changes Path 1.11 +13 -7 xml-xerces/c/src/xercesc/util/PlatformUtils.cpp Index: PlatformUtils.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/PlatformUtils.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PlatformUtils.cpp 18 May 2003 14:02:05 -0000 1.10 +++ PlatformUtils.cpp 27 Aug 2003 16:41:56 -0000 1.11 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.11 2003/08/27 16:41:56 jberry + * Add new static global that always points to array-allocating memory manager + * * Revision 1.10 2003/05/18 14:02:05 knoaman * Memory manager implementation: pass per instance manager. * @@ -169,6 +172,7 @@ #include <xercesc/util/XMLRegisterCleanup.hpp> #include <xercesc/util/DefaultPanicHandler.hpp> #include <xercesc/internal/MemoryManagerImpl.hpp> +#include <xercesc/internal/MemoryManagerArrayImpl.hpp> #include <limits.h> @@ -203,12 +207,14 @@ // --------------------------------------------------------------------------- // XMLPlatformUtils: Static Data Members // --------------------------------------------------------------------------- -XMLNetAccessor* XMLPlatformUtils::fgNetAccessor = 0; -XMLTransService* XMLPlatformUtils::fgTransService = 0; -PanicHandler* XMLPlatformUtils::fgUserPanicHandler = 0; -PanicHandler* XMLPlatformUtils::fgDefaultPanicHandler = 0; -MemoryManager* XMLPlatformUtils::fgMemoryManager = 0; -bool XMLPlatformUtils::fgMemMgrAdopted = true; +XMLNetAccessor* XMLPlatformUtils::fgNetAccessor = 0; +XMLTransService* XMLPlatformUtils::fgTransService = 0; +PanicHandler* XMLPlatformUtils::fgUserPanicHandler = 0; +PanicHandler* XMLPlatformUtils::fgDefaultPanicHandler = 0; +MemoryManager* XMLPlatformUtils::fgMemoryManager = 0; +MemoryManagerArrayImpl gArrayMemoryManager; +MemoryManager* XMLPlatformUtils::fgArrayMemoryManager = &gArrayMemoryManager; +bool XMLPlatformUtils::fgMemMgrAdopted = true; // --------------------------------------------------------------------------- // XMLPlatformUtils: Init/term methods @@ -243,7 +249,7 @@ fgMemoryManager = new MemoryManagerImpl(); } } - + // // Make sure we haven't already been initialized. Note that this is not // thread safe and is not intended for that. Its more for those COM 1.17 +11 -1 xml-xerces/c/src/xercesc/util/PlatformUtils.hpp Index: PlatformUtils.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/PlatformUtils.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- PlatformUtils.hpp 22 May 2003 22:54:25 -0000 1.16 +++ PlatformUtils.hpp 27 Aug 2003 16:41:56 -0000 1.17 @@ -152,6 +152,16 @@ */ static MemoryManager* fgMemoryManager; + /** The array-allocating memory manager + * + * This memory manager always allocates memory by calling the + * global new[] operator. It may be used to allocate memory + * where such memory needs to be deletable by calling delete []. + * Since this allocator is always guaranteed to do the same thing + * there is no reason, nor facility, to override it. + */ + static MemoryManager* fgArrayMemoryManager; + //@} 1.11 +5 -5 xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp Index: MacOSPlatformUtils.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- MacOSPlatformUtils.hpp 31 Jul 2003 18:37:29 -0000 1.10 +++ MacOSPlatformUtils.hpp 27 Aug 2003 16:41:56 -0000 1.11 @@ -98,18 +98,18 @@ // Convert fom FSRef/FSSpec to a Unicode character string path. // Note that you'll need to delete [] that string after you're done with it! XMLUTIL_EXPORT XMLCh* XMLCreateFullPathFromFSRef(const FSRef& startingRef, - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + MemoryManager* const manager = XMLPlatformUtils::fgArrayMemoryManager); XMLUTIL_EXPORT XMLCh* XMLCreateFullPathFromFSSpec(const FSSpec& startingSpec, - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + MemoryManager* const manager = XMLPlatformUtils::fgArrayMemoryManager); // Convert from path to FSRef/FSSpec // You retain ownership of the pathName. // Note: in the general case, these routines will fail if the specified file // does not exist when the routine is called. XMLUTIL_EXPORT bool XMLParsePathToFSRef(const XMLCh* const pathName, FSRef& ref, - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + MemoryManager* const manager = XMLPlatformUtils::fgArrayMemoryManager); XMLUTIL_EXPORT bool XMLParsePathToFSSpec(const XMLCh* const pathName, FSSpec& spec, - MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + MemoryManager* const manager = XMLPlatformUtils::fgArrayMemoryManager); // These routines copy characters between their representation in the Unicode Converter // and the representation used by XMLCh. Until a recent change in Xerces, these were 1.18 +3 -6 xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp Index: MacOSUnicodeConverter.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- MacOSUnicodeConverter.cpp 26 Aug 2003 21:56:30 -0000 1.17 +++ MacOSUnicodeConverter.cpp 27 Aug 2003 16:41:56 -0000 1.18 @@ -98,7 +98,6 @@ #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/util/Janitor.hpp> #include <xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp> -#include <xercesc/internal/MemoryManagerArrayImpl.hpp> XERCES_CPP_NAMESPACE_BEGIN @@ -1008,8 +1007,7 @@ { // Transcode using a memory manager that allocates // memory using new[]. - MemoryManagerArrayImpl allocator; - return transcode(srcText, &allocator); + return transcode(srcText, XMLPlatformUtils::fgArrayMemoryManager); } @@ -1129,8 +1127,7 @@ { // Transcode using a memory manager that allocates // memory using new[]. - MemoryManagerArrayImpl allocator; - return transcode(srcText, &allocator); + return transcode(srcText, XMLPlatformUtils::fgArrayMemoryManager); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]