A custom 'allocator' template argument can be used with STL containers to control
their internal memory allocation. By default this uses the standard new/delete via
the std::allocator implementation. By providing an implementation in guardedalloc
we can ensure proper accounting for allocated memory using standard Blender mechanisms.
Note that the definition of a template class in MEM_guardedalloc.h means that any C++
code using this header now must do the #include "MEM_guardedalloc.h" statement outside
of the typical extern "C" block! While the code is only compiled for C++ linkage,
the #ifdef __cplusplus conditional still is true even when using an extern "C"
block, which means the compiler will attempt C linkage on C++ code and fail.
By using the extern "C++" declaration we can avoid linker errors even when the new C++ code is included inside a extern "C" block.