Vector Deleting Destructor

Today one guy in my team asked a question regarding the behavior of delete[] operator in C++ – how does the program know it needs to call CBar::~CBar instead of CFoo::~CFoo? Note that the vector deleting destructor is a feature in Microsoft C++ Compiler, not required by the C++ standard. #define _CRTDBG_MAP_ALLOC #include <malloc.h> #include <crtdbg.h> class CFoo { public:   virtual ~CFoo() = 0; }; class CBar…

0

Undocumented Environment Variables

Although we have less Easter Eggs, there are still a huge number of undocumented behaviors. Recently I’m writing a CLR profiler using ICorProfilerCallback for fun, the CLR profiler was modeled as an in-proc COM server, and the activition was done through environment variables: SET COR_ENABLE_PROFILING=1 SET COR_PROFILER={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} SET COR_PROFILER_PATH=”C:\FOO\BAR\MyProfiler.dll” Immediately I realized there must be a lot more…

0