winbase.h declares WinMain and wWinMain, so a C++ program's definition
gets the C name the start-up code calls. An MFC program's main (from
appmainc) now calls WinMain too on Linux and macOS, so a program with
its own WinMain runs it instead of AfxWinMain; without one, the
library's WinMain runs AfxWinMain as before. memtest starts at WinMain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
DEBUG_NEW's blocks, and CObject-derived objects in a debug build, are
tracked: a header links each into a list, guard bytes surround it, and
new blocks and kept freed ones are filled. CMemoryState checkpoints,
differences, statistics and DumpAllObjectsSince work on them, as do
AfxCheckMemory, AfxIsMemoryBlock, AfxEnableMemoryTracking,
AfxDoForAllObjects, AfxSetAllocHook, afxMemDF (delayed frees and
checking on every call) and AfxDumpMemoryLeaks, which also runs when a
program ends. As with Visual C++, a release build's AfxCheckMemory,
AfxIsMemoryBlock and AfxEnableMemoryTracking are macros.
The library replaces the global operator delete so it can free its
blocks. libc++'s is weak, so it wins there. With MinGW's libstdc++ it is
weak itself, and when the runtime's is linked first only objects are
tracked (CObject's operator delete calls into the library).
CDumpContext::m_pFile is public, as in MFC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs