Very short macros have an increased liklihood of clashing with system
definitions of other symbols. In this case with a typedef in MinGW.
As the MB macro was limited to use in MemPool.* simply inline its
definition.
#endif
/// \ingroup MemPoolsAPI
-#define MB ((size_t)1024*1024)
-/// \ingroup MemPoolsAPI
-#define toMB(size) ( ((double) size) / MB )
+#define toMB(size) ( ((double) size) / ((double)(1024*1024)) )
/// \ingroup MemPoolsAPI
#define toKB(size) ( (size + 1024 - 1) / 1024 )
* all pools - including those used before main() starts where
* MemPools::GetInstance().setDefaultPoolChunking() can be called.
*/
-MemPools::MemPools() : pools(NULL), mem_idle_limit(2 * MB),
- poolCount (0), defaultIsChunked (USE_CHUNKEDMEMPOOLS && !RUNNING_ON_VALGRIND)
+MemPools::MemPools() : pools(NULL), mem_idle_limit(2 << 20 /* 2 MB */),
+ poolCount(0), defaultIsChunked(USE_CHUNKEDMEMPOOLS && !RUNNING_ON_VALGRIND)
{
char *cfg = getenv("MEMPOOLS");
if (cfg)