We frequenty allocate sizeof(T) memory and call T ctor on that memory
(C++ new keyword effectively). Currently it's quite verbose and
usually takes 2 lines of code.
Add New<T>() helper that does it much more concisely.
Rename internal_free to Free that also sets the pointer to nullptr.
Shorter and safer.
Rename internal_alloc to Alloc, just shorter.
You could make New also forward arguments:
template <typename T, typename... U> T *New(U&&... u) { return new (Alloc(sizeof(T))) T(std::forward<U>(u)...)); }Then in other locations where you're still doing placement new + alloc you could also just use New<Foo>(args,..)