]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/align/test/aligned_alloc_test.cpp
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 #include <boost/align/aligned_alloc.hpp>
9 #include <boost/align/is_aligned.hpp>
10 #include <boost/core/lightweight_test.hpp>
13 void test(std::size_t alignment
)
16 void* p
= boost::alignment::aligned_alloc(alignment
, alignment
+ 1);
18 BOOST_TEST(boost::alignment::is_aligned(p
, alignment
));
19 std::memset(p
, 0, alignment
);
20 boost::alignment::aligned_free(p
);
23 void* p
= boost::alignment::aligned_alloc(alignment
, 1);
25 BOOST_TEST(boost::alignment::is_aligned(p
, alignment
));
27 boost::alignment::aligned_free(p
);
30 void* p
= boost::alignment::aligned_alloc(alignment
, 0);
31 boost::alignment::aligned_free(p
);
46 return boost::report_errors();