Commit e176dd78fd2f253eb2625585b2bd90b5713e5984 replaced a `new char[n]` with a std::make_unique<char[]>(n), probably on this author's insistence. But the two are not equivalent: make_unique() value-initializes, even arrays, even of built-in type, which means that each buffer resize writes each byte twice: first nulling out the whole buffer as part of value-initialization, then in the memcpy() and any following read()s. For buffers of several MiB, or even GiB in size, this is very costly. Fix by adding and using a backport of C++20 make_unique_for_overwrite(), which performs the equivalent of the old code (ie. default-, not value-initialization). Also add q20::is_(un)bounded_array, which are needed for the implementation of q20::make_unique_for_overwrite(). Amends e176dd78fd2f253eb2625585b2bd90b5713e5984. Pick-to: 6.9 6.8 6.5 Change-Id: I8865c7369e522ec475df122e3d00d6aba3b24561 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%