We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 315a922 commit af06112Copy full SHA for af06112
libcxx/include/__utility/small_buffer.h
@@ -66,7 +66,9 @@ class __small_buffer {
66
if constexpr (__fits_in_buffer<_Stored>) {
67
return std::launder(reinterpret_cast<_Stored*>(__buffer_));
68
} else {
69
- return static_cast<_Stored*>(std::__libcpp_allocate(_BufferSize * sizeof(byte), alignof(_Stored)));
+ byte* __allocation = static_cast<byte*>(std::__libcpp_allocate(sizeof(_Stored), alignof(_Stored)));
70
+ std::construct_at(reinterpret_cast<byte**>(__buffer_), __allocation);
71
+ return std::launder(reinterpret_cast<_Stored*>(__allocation));
72
}
73
74
0 commit comments