There was an error while loading. Please reload this page.
1 parent 991a95b commit c9e28ffCopy full SHA for c9e28ff
1 file changed
include/boost/cobalt/detail/sbo_resource.hpp
@@ -41,12 +41,12 @@ struct sbo_resource
41
}
42
constexpr void align_as_max_()
43
{
44
- const auto buffer = static_cast<char*>(buffer_.p) - static_cast<char*>(nullptr);
+ const auto buffer = reinterpret_cast<std::uintptr_t>(buffer_.p);
45
const auto diff = buffer % alignof(std::max_align_t );
46
if (diff > 0)
47
48
const auto padding = alignof(std::max_align_t) - diff;
49
- buffer_.p = static_cast<void*>(static_cast<char*>(nullptr) + buffer + padding);
+ buffer_.p = static_cast<char*>(buffer_.p) + padding;
50
if (padding >= buffer_.size) [[unlikely]]
51
52
buffer_.size = 0;
0 commit comments