Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libcxx/include/__utility/small_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class __small_buffer {
return *std::launder(reinterpret_cast<_Stored**>(__buffer_));
}

# ifdef _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
template <class _Stored>
_LIBCPP_HIDE_FROM_ABI _Stored* __alloc() {
if constexpr (__fits_in_buffer<_Stored>) {
Expand All @@ -72,11 +73,14 @@ class __small_buffer {
}
}

# endif // _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
# ifdef _LIBCPP_HAS_LIBRARY_SIZED_DEALLOCATION
template <class _Stored>
_LIBCPP_HIDE_FROM_ABI void __dealloc() noexcept {
if constexpr (!__fits_in_buffer<_Stored>)
::operator delete[](*reinterpret_cast<void**>(__buffer_), sizeof(_Stored), align_val_t{alignof(_Stored)});
}
# endif // _LIBCPP_HAS_LIBRARY_SIZED_DEALLOCATION

template <class _Stored, class... _Args>
_LIBCPP_HIDE_FROM_ABI void __construct(_Args&&... __args) {
Expand Down
Loading