]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/align/test/aligned_delete_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/aligned_delete.hpp>
10 #include <boost/align/alignment_of.hpp>
11 #include <boost/core/lightweight_test.hpp>
16 static unsigned count
;
28 type
& operator=(const type
&);
31 unsigned type::count
= 0;
36 void* p
= boost::alignment::aligned_alloc(1, 1);
37 char* q
= ::new(p
) char;
38 boost::alignment::aligned_delete()(q
);
42 N
= boost::alignment::alignment_of
<type
>::value
44 void* p
= boost::alignment::aligned_alloc(N
, sizeof(type
));
45 type
* q
= ::new(p
) type
;
46 BOOST_TEST(type::count
== 1);
47 boost::alignment::aligned_delete()(q
);
48 BOOST_TEST(type::count
== 0);
50 return boost::report_errors();