File indexing completed on 2025-01-18 09:28:26
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ALIGN_DETAIL_ALIGN_UP_HPP
0009 #define BOOST_ALIGN_DETAIL_ALIGN_UP_HPP
0010
0011 #include <boost/align/detail/is_alignment.hpp>
0012 #include <boost/assert.hpp>
0013
0014 namespace boost {
0015 namespace alignment {
0016
0017 inline void*
0018 align_up(void* ptr, std::size_t alignment) BOOST_NOEXCEPT
0019 {
0020 BOOST_ASSERT(detail::is_alignment(alignment));
0021 return reinterpret_cast<void*>(~(alignment - 1) &
0022 (reinterpret_cast<std::size_t>(ptr) + alignment - 1));
0023 }
0024
0025 }
0026 }
0027
0028 #endif