diff --git a/CGAL_Core/include/CGAL/CORE/CoreDefs.h b/CGAL_Core/include/CGAL/CORE/CoreDefs.h index a05da44ff3c..f5c3a8667e7 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreDefs.h +++ b/CGAL_Core/include/CGAL/CORE/CoreDefs.h @@ -128,7 +128,7 @@ CGAL_GLOBAL_STATE_VAR(extLong, defInputDigits, CORE_posInfty) /** This value cannot be CORE_INFTY See also defBigFloatOutputDigits. (it really should be an int, as in std::cout.setprecision(int)). */ -CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defOutputDigits, get_static_defBigFloatOutputDigits()) +CGAL_GLOBAL_STATE_VAR(CGAL::cpp11::atomic, defOutputDigits, 10) // == get_static_defBigFloatOutputDigits() /// default input precision in digits for converting a string to a BigFloat /** This value cannot be CORE_INFTY. */ diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index 46b2cc91e4b..0707d57c2ff 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -37,6 +37,7 @@ #include // for placement new #include #include +#include #include namespace CORE { @@ -50,6 +51,7 @@ private: Thunk* next; }; + typedef MemoryPool Self; public: MemoryPool() : head( 0 ) {} @@ -78,7 +80,8 @@ public: void free(void* p); // Access the corresponding static global allocator. - static MemoryPool& global_allocator() { + static MemoryPool& global_allocator() { + CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(Self, memPool); return memPool; } @@ -86,14 +89,9 @@ private: Thunk* head; // next available block in the pool std::vector blocks; -private: - // Static global allocator. - static MemoryPool memPool; + }; -template -MemoryPool MemoryPool::memPool; - template< class T, int nObjects > void* MemoryPool< T, nObjects >::allocate(std::size_t) { if ( head == 0 ) { // if no more memory in the pool