[mapguide-commits] r5882 - trunk/MgDev/Oem/dbxml/xqilla/include/xqilla/framework

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 31 04:48:45 EDT 2011


Author: hubu
Date: 2011-05-31 01:48:45 -0700 (Tue, 31 May 2011)
New Revision: 5882

Modified:
   trunk/MgDev/Oem/dbxml/xqilla/include/xqilla/framework/XPath2MemoryManager.hpp
Log:
RFC107 - porting mapguide server to VS2010.
The dbxml/xqilla is not compatible with vs2010, just remove the _Singleton from the XQillaAllocator class. This change will affect the performance, when allocate a single unit memory with XQillaAllocator on VS2010 Debug. For release and vs2008, this change will not affect performance.
This is a workaround to make the dbxml work. Oracle will release BerkeleyDB which is supporting vs2010 in the future, and we will integrate it at that time.

Modified: trunk/MgDev/Oem/dbxml/xqilla/include/xqilla/framework/XPath2MemoryManager.hpp
===================================================================
--- trunk/MgDev/Oem/dbxml/xqilla/include/xqilla/framework/XPath2MemoryManager.hpp	2011-05-31 07:11:07 UTC (rev 5881)
+++ trunk/MgDev/Oem/dbxml/xqilla/include/xqilla/framework/XPath2MemoryManager.hpp	2011-05-31 08:48:45 UTC (rev 5882)
@@ -131,8 +131,10 @@
 #endif
   pointer allocate(size_t _n, const void* = 0)
   {
+#if _MSC_VER < 1600 || NDEBUG //for VS2010 Release or VS2008
     if(_n==1)
       return (pointer)_singleton;
+#endif
     //std::cout << "XQillaAllocator::allocate(" << _n << ")" << std::endl;
     if(_memMgr)
       return _n != 0 ? static_cast<pointer>(_memMgr->allocate(_n*sizeof(_Tp))) : 0;
@@ -143,15 +145,24 @@
   void deallocate(void* _p, size_t _n)
   {
     //std::cout << "XQillaAllocator::deallocate(" << _n << ")" << std::endl;
-    if(_p) {
-      if(_p!=_singleton) {
-        if(_memMgr)
-          _memMgr->deallocate(_p);
-        else
-          free(_p);
-      }
+    #if _MSC_VER < 1600 || NDEBUG //for VS2010 Release or VS2008
+        if(_p) {
+          if(_p!=_singleton) {
+            if(_memMgr)
+              _memMgr->deallocate(_p);
+            else
+              free(_p);
+          }
+        }
+    #else //for VS2010 Debug
+        if(_p) {
+            if(_memMgr)
+                _memMgr->deallocate(_p);
+            else
+                free(_p);
+        }
+    #endif
   }
-  }
 
   void construct(pointer _p, const_reference _v)
   {
@@ -173,7 +184,10 @@
     return 0xFFFFFFFF;
   }
 
+  #if _MSC_VER < 1600 || NDEBUG //for VS2010 Release or VS2008
   char _singleton[sizeof(_Tp)];
+  #endif
+
   XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* _memMgr;
 };
 



More information about the mapguide-commits mailing list