A virtual heap done in C++