tsan: introduce New/Alloc/Free helpers
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. Reviewed By: vitalybuka, melver Differential Revision: https://reviews.llvm.org/D107085
Loading
Please register or sign in to comment