C++ manual memory allocator