Skip to content

Commit 5bd213b

Browse files
authored
Merge pull request ceph#62991 from tchaikov/common-aligned_storage
common: avoid using std::aligned_storage_t Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents f838339 + 07ac4c3 commit 5bd213b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/common/containers.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ namespace ceph::containers {
5656
template<typename Value, std::size_t InternalCapacity = 0>
5757
class tiny_vector {
5858
// NOTE: to avoid false sharing consider aligning to cache line
59-
using storage_unit_t = \
60-
std::aligned_storage_t<sizeof(Value), alignof(Value)>;
59+
struct alignas(Value) storage_unit_t {
60+
unsigned char data[sizeof(Value)];
61+
};
6162

6263
std::size_t _size = 0;
6364
storage_unit_t* const data = nullptr;

0 commit comments

Comments
 (0)