Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions include/boost/fiber/buffered_channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ class buffered_channel {

class iterator {
private:
typedef typename std::aligned_storage< sizeof( value_type), alignof( value_type) >::type storage_type;
typedef unsigned char storage_type[sizeof(value_type)];

buffered_channel * chan_{ nullptr };
storage_type storage_;
buffered_channel * chan_{ nullptr };
alignas(value_type) storage_type storage_;

void increment_( bool initial = false) {
BOOST_ASSERT( nullptr != chan_);
Expand Down
6 changes: 3 additions & 3 deletions include/boost/fiber/unbuffered_channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ class unbuffered_channel {

class iterator {
private:
typedef typename std::aligned_storage< sizeof( value_type), alignof( value_type) >::type storage_type;
typedef unsigned char storage_type[sizeof(value_type)];

unbuffered_channel * chan_{ nullptr };
storage_type storage_;
unbuffered_channel * chan_{ nullptr };
alignas(value_type) storage_type storage_;

void increment_( bool initial = false) {
BOOST_ASSERT( nullptr != chan_);
Expand Down
4 changes: 2 additions & 2 deletions performance/thread/buffered_channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class buffered_channel {
typedef T value_type;

private:
typedef typename std::aligned_storage< sizeof( T), alignof( T) >::type storage_type;
typedef unsigned char storage_type[sizeof(T)];

struct alignas(cache_alignment) slot {
std::atomic< std::size_t > cycle{ 0 };
storage_type storage{};
alignas(T) storage_type storage{};

slot() = default;
};
Expand Down