static double xm_time = 0;
static double xm_deltat = 0;
-/* all pools are ready to be used */
-static bool MemIsInitialized = false;
-
/* string pools */
#define mem_str_pool_count 6
*gross_size = pool ? pool->objectSize() : net_size;
assert(*gross_size >= net_size);
- // may forget [de]allocations until MemIsInitialized
++StrCountMeter;
StrVolumeMeter += *gross_size;
return pool ? pool->alloc() : xcalloc(1, net_size);
if (type != MEM_NONE)
pool = GetStrPool(type);
- // may forget [de]allocations until MemIsInitialized
--StrCountMeter;
StrVolumeMeter -= size;
pool ? pool->freeOne(buf) : xfree(buf);
void
Mem::Init(void)
{
+ /* all pools are ready to be used */
+ static bool MemIsInitialized = false;
+ if (MemIsInitialized)
+ return;
+
/** \par
* NOTE: Mem::Init() is called before the config file is parsed
* and before the debugging module has been initialized. Any