]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/align/detail/aligned_alloc_android.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / align / detail / aligned_alloc_android.hpp
1 /*
2 Copyright 2014 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7 */
8 #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP
9 #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP
10
11 #include <boost/align/detail/is_alignment.hpp>
12 #include <boost/assert.hpp>
13 #include <malloc.h>
14
15 namespace boost {
16 namespace alignment {
17
18 inline void*
19 aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT
20 {
21 BOOST_ASSERT(detail::is_alignment(alignment));
22 return ::memalign(alignment, size);
23 }
24
25 inline void
26 aligned_free(void* ptr) BOOST_NOEXCEPT
27 {
28 ::free(ptr);
29 }
30
31 } /* alignment */
32 } /* boost */
33
34 #endif