// Ensure the memory manager is constructed extremely early on#pragma warning(disable:4074) // warning C4074: initializers put in compiler reserved initialization area#pragma init_seg(compiler)struct MemoryInitialiser{ MemoryInitialiser() { PMemory::Create(); } ~MemoryInitialiser() { PMemory::Destroy(); }} g_theMemoryInitialiser;
Hoorah for #pragma init_seg! Incidently, the STL global appears to be in the lib segment, because putting that struct into the lib segment still showed the memory "leaks".
In other news:
Jack