2 Copyright 2014 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP
9 #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP
11 #include <boost/align/detail/is_alignment.hpp>
12 #include <boost/assert.hpp>
19 aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT
21 BOOST_ASSERT(detail::is_alignment(alignment));
25 if (alignment < sizeof(void*)) {
26 alignment = sizeof(void*);
29 if (::posix_memalign(&p, alignment, size) != 0) {
36 aligned_free(void* ptr) BOOST_NOEXCEPT