]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/align/test/aligned_alloc_test.cpp
2c10e06e5a23e149f549c9604e265d576fb7b791
2 (c) 2014 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
5 Distributed under the Boost Software
7 http://boost.org/LICENSE_1_0.txt
9 #include <boost/align/aligned_alloc.hpp>
10 #include <boost/align/is_aligned.hpp>
11 #include <boost/core/lightweight_test.hpp>
14 void test(std::size_t alignment
)
17 void* p
= boost::alignment::aligned_alloc(alignment
,
20 BOOST_TEST(boost::alignment::is_aligned(p
, alignment
));
22 boost::alignment::aligned_free(p
);
25 void* p
= boost::alignment::aligned_alloc(alignment
,
28 BOOST_TEST(boost::alignment::is_aligned(p
, alignment
));
30 boost::alignment::aligned_free(p
);
33 void* p
= boost::alignment::aligned_alloc(alignment
,
36 BOOST_TEST(boost::alignment::is_aligned(p
, alignment
));
38 boost::alignment::aligned_free(p
);
40 void* p
= boost::alignment::aligned_alloc(alignment
, 0);
41 boost::alignment::aligned_free(p
);
56 return boost::report_errors();