wrappers around operator new and operator delete
Summary: C++14 introduces sized overloads of `operator delete` and C++17 introduces aligned overloads of `operator new` and `operator delete`. Offer wrappers which call the best available versions. Using these overloads, asking for heap storage suitable for a non-over-aligned class can be done via these wrappers without requiring call-sites to test feature macros. Most potential use-cases should use `std::allocator<T>::allocate` and `std::allocator<T>::deallocate`. Reasons why use-cases may turn to these wrappers instead are: * These wrappers are not temnplates and using them does not instantiate class or function templates. * `std::allocator<T>::deallocate` may, but is not specified to, use sized deallocation when sized deallocation is available. Reviewed By: luciang Differential Revision: D33180956 fbshipit-source-id: 944fe6a01ca4cfff72f3b92639158e4a5ac029b8
Showing
folly/lang/New.h
0 → 100644
folly/lang/test/NewTest.cpp
0 → 100644
Please register or sign in to comment