X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Falign%2Ftest%2Faligned_alloc_test.cpp;h=925d77f86e979b5ab673c9d6b5064c83b4f126ef;hb=b32b81446b3b05102be0267e79203f59329c1d97;hp=2c10e06e5a23e149f549c9604e265d576fb7b791;hpb=215dd7151453fae88e6f968c975b6ce309d42dcf;p=ceph.git diff --git a/ceph/src/boost/libs/align/test/aligned_alloc_test.cpp b/ceph/src/boost/libs/align/test/aligned_alloc_test.cpp index 2c10e06e5..925d77f86 100644 --- a/ceph/src/boost/libs/align/test/aligned_alloc_test.cpp +++ b/ceph/src/boost/libs/align/test/aligned_alloc_test.cpp @@ -1,10 +1,9 @@ /* -(c) 2014 Glen Joseph Fernandes - +Copyright 2014 Glen Joseph Fernandes +(glenjofe@gmail.com) -Distributed under the Boost Software -License, Version 1.0. -http://boost.org/LICENSE_1_0.txt +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) */ #include #include @@ -14,29 +13,20 @@ http://boost.org/LICENSE_1_0.txt void test(std::size_t alignment) { { - void* p = boost::alignment::aligned_alloc(alignment, - alignment); + void* p = boost::alignment::aligned_alloc(alignment, alignment + 1); BOOST_TEST(p != 0); BOOST_TEST(boost::alignment::is_aligned(p, alignment)); - std::memset(p, 0, 1); + std::memset(p, 0, alignment); boost::alignment::aligned_free(p); } { - void* p = boost::alignment::aligned_alloc(alignment, - alignment + 1); + void* p = boost::alignment::aligned_alloc(alignment, 1); BOOST_TEST(p != 0); BOOST_TEST(boost::alignment::is_aligned(p, alignment)); std::memset(p, 0, 1); boost::alignment::aligned_free(p); } - if (alignment > 1) { - void* p = boost::alignment::aligned_alloc(alignment, - alignment - 1); - BOOST_TEST(p != 0); - BOOST_TEST(boost::alignment::is_aligned(p, alignment)); - std::memset(p, 0, 1); - boost::alignment::aligned_free(p); - } else { + { void* p = boost::alignment::aligned_alloc(alignment, 0); boost::alignment::aligned_free(p); }