77// See http://www.boost.org/libs/container for documentation.
88//
99// ////////////////////////////////////////////////////////////////////////////
10- #ifndef BOOST_CONTAINER_DETAIL_ALIGNED_ALLOC_HPP
11- #define BOOST_CONTAINER_DETAIL_ALIGNED_ALLOC_HPP
10+ #ifndef BOOST_CONTAINER_DETAIL_ALIGNED_ALLOCATION_HPP
11+ #define BOOST_CONTAINER_DETAIL_ALIGNED_ALLOCATION_HPP
1212
1313#ifndef BOOST_CONFIG_HPP
1414# include < boost/config.hpp>
2525 #include < unistd.h> // Include it to detect POSIX features
2626 #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)
2727 #define BOOST_CONTAINER_HAS_POSIX_MEMALIGN
28- #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)
29- #define BOOST_CONTAINER_HAS_POSIX_MEMALIGN
3028 #elif defined(__APPLE__)
3129 #include < Availability.h>
3230 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
@@ -86,7 +84,7 @@ inline void* aligned_allocate(std::size_t al, std::size_t sz)
8684 std::size_t rounded_size = std::size_t (sz + al - 1u ) & ~std::size_t (al - 1 );
8785
8886 // Check for rounded size overflow
89- return rounded_size ? aligned_allocate (al, rounded_size) : 0 ;
87+ return rounded_size ? :: aligned_alloc (al, rounded_size) : 0 ;
9088}
9189
9290#elif defined(BOOST_CONTAINER_HAS_ALIGNED_MALLOC)
@@ -106,12 +104,12 @@ inline void* aligned_allocate(std::size_t al, std::size_t sz)
106104 return 0 ;
107105
108106 // Now align the returned pointer (which will be aligned at least to sizeof(void*)
109- std::size_t raw_addr = reinterpret_cast <std::size_t >(mptr);
110- std::size_t offset = sizeof (void *);
107+ const std::size_t raw_addr = reinterpret_cast <std::size_t >(mptr);
108+ const std::size_t offset = sizeof (void *);
111109 void *const ptr = reinterpret_cast <void *>((raw_addr + offset + al - 1u ) & ~(al - 1u ));
112110
113111 // Store the original pointer just before the aligned address
114- void ** backpointer = reinterpret_cast <void **>(ptr) - 1 ;
112+ void ** const backpointer = reinterpret_cast <void **>(ptr) - 1 ;
115113 *backpointer = mptr;
116114 return ptr;
117115}
@@ -149,4 +147,4 @@ inline void aligned_deallocate(void* ptr)
149147} // namespace container {
150148} // namespace boost {
151149
152- #endif // #ifndef BOOST_CONTAINER_DETAIL_ALIGNED_ALLOC_HPP
150+ #endif // #ifndef BOOST_CONTAINER_DETAIL_ALIGNED_ALLOCATION_HPP
0 commit comments