detail/align.hpp
Go to the documentation of this file.
1 /*
2 (c) 2014-2016 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
4 
5 Distributed under the Boost Software
6 License, Version 1.0.
7 http://boost.org/LICENSE_1_0.txt
8 */
9 #ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP
10 #define BOOST_ALIGN_DETAIL_ALIGN_HPP
11 
13 #include <boost/assert.hpp>
14 
15 namespace boost {
16 namespace alignment {
17 
18 inline void* align(std::size_t alignment, std::size_t size,
19  void*& ptr, std::size_t& space)
20 {
22  if (size <= space) {
23  char* p = (char*)(((std::size_t)ptr + alignment - 1) &
24  ~(alignment - 1));
25  std::size_t n = space - (p - static_cast<char*>(ptr));
26  if (size <= n) {
27  ptr = p;
28  space = n;
29  return p;
30  }
31  }
32  return 0;
33 }
34 
35 } /* .alignment */
36 } /* .boost */
37 
38 #endif
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::alignment::align
void * align(std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space)
Definition: detail/align.hpp:18
is_alignment.hpp
BOOST_ASSERT
#define BOOST_ASSERT(expr)
Definition: assert.hpp:60
boost::alignment::detail::is_alignment
BOOST_CONSTEXPR bool is_alignment(std::size_t value) BOOST_NOEXCEPT
Definition: is_alignment.hpp:19
assert.hpp


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:36:30