Quote:This intrigues me. At least I've never heard of such technique, most other memory managers need to be included at beginning.
The ones that require including at the beginning will typically use macros and redefine new/malloc, which breaks placement new and member functions that happen to be called free, etc.
The init_seg / __declspec(allocate) technique is useful for performing init before main, before constructors run, or even before the CRT modules are initialized. See http://blogs.msdn.com/larryosterman/archive/2004/09/27/234840.aspx for an explanation.
Incidentally, Steve overrides global operator new, which happens at link-time and requires no init, but the synchronization object and dbghelp do. BTW, another advantage of allocation hooks is that they are called while under the CRT _HEAP_LOCK, which goes a long way towards making a memory manager thread-safe without any further work.
Quote:The problem MindWipe was having turned out to be a genuine memory leak (GLUT never returning, so memory never being deleted), but I thought it was because some global was getting destroyed after the _CrtDumpLeakCheck (Or whatever the function is).
Ah, ok. You can pretty much rely on the CRT report because it has the final word on shutdown order.
Zipster: good idea. 28 MB in spite of this optimization, though? That is an excellent motivation for me to finish up the zero storage scheme :)