C++ Memory manager built around multi-threading