Memory Management Utility in C++