0023592: Enabling TBB allocator by default for OCC built with -DHAVE_TBB
authorRoman Lygin <roman.lygin@gmail.com>
Fri, 7 Dec 2012 08:08:09 +0000 (12:08 +0400)
committerRoman Lygin <roman.lygin@gmail.com>
Fri, 7 Dec 2012 08:08:09 +0000 (12:08 +0400)
Implementation updated based on discussion with OCC team

src/Standard/Standard.cxx

index 1ea0610..9341a94 100755 (executable)
 #include <malloc.h>
 #endif
 
+#ifndef OCCT_MMGT_OPT_DEFAULT
+#define OCCT_MMGT_OPT_DEFAULT 0
+#endif
+
 // Global reentrant flag
 static Standard_Boolean Standard_IsReentrant = Standard_True;
 
@@ -60,7 +64,8 @@ Standard_MMgrFactory::Standard_MMgrFactory()
 : myFMMgr (NULL)
 {
   char* aVar;
-  Standard_Integer anAllocId   = (aVar = getenv ("MMGT_OPT"      )) ?  atoi (aVar)       : 0;
+  Standard_Integer anAllocId   = (aVar = getenv ("MMGT_OPT"      )) ?  atoi (aVar)       :
+    (OCCT_MMGT_OPT_DEFAULT);
   Standard_Boolean toClear     = (aVar = getenv ("MMGT_CLEAR"    )) ? (atoi (aVar) != 0) : Standard_True;