?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/align.tar
???????
aligned_delete_forward.hpp 0000644 00000000560 15125235257 0011736 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_DELETE_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_DELETE_FORWARD_HPP namespace boost { namespace alignment { struct aligned_delete; } /* alignment */ } /* boost */ #endif aligned_delete.hpp 0000644 00000001237 15125235257 0010214 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_DELETE_HPP #define BOOST_ALIGN_ALIGNED_DELETE_HPP #include <boost/align/aligned_alloc.hpp> #include <boost/align/aligned_delete_forward.hpp> namespace boost { namespace alignment { struct aligned_delete { template<class T> void operator()(T* ptr) const BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(ptr->~T())) { if (ptr) { ptr->~T(); boost::alignment::aligned_free(ptr); } } }; } /* alignment */ } /* boost */ #endif alignment_of_forward.hpp 0000644 00000000567 15125235257 0011462 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP #define BOOST_ALIGN_ALIGNMENT_OF_FORWARD_HPP namespace boost { namespace alignment { template<class T> struct alignment_of; } /* alignment */ } /* boost */ #endif aligned_allocator.hpp 0000644 00000007215 15125235257 0010734 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP #include <boost/align/detail/add_reference.hpp> #include <boost/align/detail/is_alignment_constant.hpp> #include <boost/align/detail/max_objects.hpp> #include <boost/align/detail/max_size.hpp> #include <boost/align/detail/throw_exception.hpp> #include <boost/align/aligned_alloc.hpp> #include <boost/align/aligned_allocator_forward.hpp> #include <boost/align/alignment_of.hpp> #include <boost/static_assert.hpp> #include <new> #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #include <utility> #endif namespace boost { namespace alignment { template<class T, std::size_t Alignment> class aligned_allocator { BOOST_STATIC_ASSERT(detail::is_alignment_constant<Alignment>::value); public: typedef T value_type; typedef T* pointer; typedef const T* const_pointer; typedef void* void_pointer; typedef const void* const_void_pointer; typedef typename detail::add_lvalue_reference<T>::type reference; typedef typename detail::add_lvalue_reference<const T>::type const_reference; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef detail::true_type propagate_on_container_move_assignment; typedef detail::true_type is_always_equal; template<class U> struct rebind { typedef aligned_allocator<U, Alignment> other; }; #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) aligned_allocator() = default; #else aligned_allocator() BOOST_NOEXCEPT { } #endif template<class U> aligned_allocator(const aligned_allocator<U, Alignment>&) BOOST_NOEXCEPT { } pointer allocate(size_type size, const_void_pointer = 0) { enum { m = detail::max_size<Alignment, alignment_of<value_type>::value>::value }; if (size == 0) { return 0; } void* p = boost::alignment::aligned_alloc(m, sizeof(T) * size); if (!p) { detail::throw_exception(std::bad_alloc()); } return static_cast<T*>(p); } void deallocate(pointer ptr, size_type) { boost::alignment::aligned_free(ptr); } BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { return detail::max_objects<T>::value; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template<class U, class... Args> void construct(U* ptr, Args&&... args) { ::new((void*)ptr) U(std::forward<Args>(args)...); } #else template<class U, class V> void construct(U* ptr, V&& value) { ::new((void*)ptr) U(std::forward<V>(value)); } #endif #else template<class U, class V> void construct(U* ptr, const V& value) { ::new((void*)ptr) U(value); } template<class U, class V> void construct(U* ptr, V& value) { ::new((void*)ptr) U(value); } #endif template<class U> void construct(U* ptr) { ::new((void*)ptr) U(); } template<class U> void destroy(U* ptr) { (void)ptr; ptr->~U(); } }; template<class T, class U, std::size_t Alignment> inline bool operator==(const aligned_allocator<T, Alignment>&, const aligned_allocator<U, Alignment>&) BOOST_NOEXCEPT { return true; } template<class T, class U, std::size_t Alignment> inline bool operator!=(const aligned_allocator<T, Alignment>&, const aligned_allocator<U, Alignment>&) BOOST_NOEXCEPT { return false; } } /* alignment */ } /* boost */ #endif alignment_of.hpp 0000644 00000003210 15125235257 0007722 0 ustar 00 /* Copyright 2014-2016 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNMENT_OF_HPP #define BOOST_ALIGN_ALIGNMENT_OF_HPP #include <boost/align/detail/element_type.hpp> #include <boost/align/alignment_of_forward.hpp> #if defined(_MSC_VER) && defined(__clang__) #include <boost/align/detail/alignment_of_cxx11.hpp> #elif defined(BOOST_MSVC) #include <boost/align/detail/alignment_of_msvc.hpp> #elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) #include <boost/align/detail/alignment_of.hpp> #elif defined(BOOST_CLANG) && !defined(__x86_64__) #include <boost/align/detail/alignment_of.hpp> #elif !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #include <boost/align/detail/alignment_of_cxx11.hpp> #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) #include <boost/align/detail/alignment_of_gcc.hpp> #elif defined(BOOST_CODEGEARC) #include <boost/align/detail/alignment_of_codegear.hpp> #elif defined(BOOST_CLANG) #include <boost/align/detail/alignment_of_clang.hpp> #elif __GNUC__ > 4 #include <boost/align/detail/alignment_of_gcc.hpp> #elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) #include <boost/align/detail/alignment_of_gcc.hpp> #else #include <boost/align/detail/alignment_of.hpp> #endif namespace boost { namespace alignment { template<class T> struct alignment_of : detail::alignment_of<typename detail::element_type<T>::type>::type { }; #if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) template<class T> constexpr std::size_t alignment_of_v = alignment_of<T>::value; #endif } /* alignment */ } /* boost */ #endif aligned_allocator_adaptor_forward.hpp 0000644 00000000724 15125235257 0014170 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_FORWARD_HPP #include <cstddef> namespace boost { namespace alignment { template<class Allocator, std::size_t Alignment = 1> class aligned_allocator_adaptor; } /* alignment */ } /* boost */ #endif aligned_alloc.hpp 0000644 00000003041 15125235257 0010037 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_ALLOC_HPP #define BOOST_ALIGN_ALIGNED_ALLOC_HPP #include <boost/config.hpp> #if defined(BOOST_HAS_UNISTD_H) #include <unistd.h> #endif #if defined(__APPLE__) || defined(__APPLE_CC__) || defined(macintosh) #include <AvailabilityMacros.h> #endif #if defined(BOOST_ALIGN_USE_ALIGN) #include <boost/align/detail/aligned_alloc.hpp> #elif defined(BOOST_ALIGN_USE_NEW) #include <boost/align/detail/aligned_alloc_new.hpp> #elif defined(_MSC_VER) && !defined(UNDER_CE) #include <boost/align/detail/aligned_alloc_msvc.hpp> #elif defined(__MINGW32__) && (__MSVCRT_VERSION__ >= 0x0700) #include <boost/align/detail/aligned_alloc_msvc.hpp> #elif defined(__MINGW32__) #include <boost/align/detail/aligned_alloc_mingw.hpp> #elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 #include <boost/align/detail/aligned_alloc_posix.hpp> #elif MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 #include <boost/align/detail/aligned_alloc_macos.hpp> #elif defined(__ANDROID__) #include <boost/align/detail/aligned_alloc_android.hpp> #elif defined(__SunOS_5_11) || defined(__SunOS_5_12) #include <boost/align/detail/aligned_alloc_posix.hpp> #elif defined(sun) || defined(__sun) #include <boost/align/detail/aligned_alloc_sunos.hpp> #elif (_POSIX_C_SOURCE >= 200112L) || (_XOPEN_SOURCE >= 600) #include <boost/align/detail/aligned_alloc_posix.hpp> #else #include <boost/align/detail/aligned_alloc.hpp> #endif #endif aligned_allocator_forward.hpp 0000644 00000000664 15125235257 0012461 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_FORWARD_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_FORWARD_HPP #include <cstddef> namespace boost { namespace alignment { template<class T, std::size_t Alignment = 1> class aligned_allocator; } /* alignment */ } /* boost */ #endif assume_aligned.hpp 0000644 00000001422 15125235257 0010243 0 ustar 00 /* Copyright 2015 NumScale SAS Copyright 2015 LRI UMR 8623 CNRS/University Paris Sud XI Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ASSUME_ALIGNED_HPP #define BOOST_ALIGN_ASSUME_ALIGNED_HPP #include <boost/config.hpp> #if defined(BOOST_MSVC) #include <boost/align/detail/assume_aligned_msvc.hpp> #elif defined(BOOST_CLANG) && defined(__has_builtin) #include <boost/align/detail/assume_aligned_clang.hpp> #elif BOOST_GCC_VERSION >= 40700 #include <boost/align/detail/assume_aligned_gcc.hpp> #elif defined(__INTEL_COMPILER) #include <boost/align/detail/assume_aligned_intel.hpp> #else #include <boost/align/detail/assume_aligned.hpp> #endif #endif is_aligned.hpp 0000644 00000001132 15125235257 0007357 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_IS_ALIGNED_HPP #define BOOST_ALIGN_IS_ALIGNED_HPP #include <boost/align/detail/is_aligned.hpp> #include <boost/align/detail/not_pointer.hpp> namespace boost { namespace alignment { template<class T> BOOST_CONSTEXPR inline typename detail::not_pointer<T, bool>::type is_aligned(T value, std::size_t alignment) BOOST_NOEXCEPT { return (value & (T(alignment) - 1)) == 0; } } /* alignment */ } /* boost */ #endif aligned_allocator_adaptor.hpp 0000644 00000011763 15125235257 0012451 0 ustar 00 /* Copyright 2014-2016 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP #define BOOST_ALIGN_ALIGNED_ALLOCATOR_ADAPTOR_HPP #include <boost/align/detail/is_alignment_constant.hpp> #include <boost/align/detail/max_align.hpp> #include <boost/align/detail/max_size.hpp> #include <boost/align/align.hpp> #include <boost/align/aligned_allocator_adaptor_forward.hpp> #include <boost/align/alignment_of.hpp> #include <boost/core/pointer_traits.hpp> #include <boost/static_assert.hpp> #include <new> #if !defined(BOOST_NO_CXX11_ALLOCATOR) #include <memory> #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #include <utility> #endif namespace boost { namespace alignment { template<class Allocator, std::size_t Alignment> class aligned_allocator_adaptor : public Allocator { BOOST_STATIC_ASSERT(detail::is_alignment_constant<Alignment>::value); #if !defined(BOOST_NO_CXX11_ALLOCATOR) typedef std::allocator_traits<Allocator> traits; typedef typename traits::template rebind_alloc<char> char_alloc; typedef typename traits::template rebind_traits<char> char_traits; typedef typename char_traits::pointer char_ptr; #else typedef typename Allocator::template rebind<char>::other char_alloc; typedef typename char_alloc::pointer char_ptr; #endif public: typedef typename Allocator::value_type value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef void* void_pointer; typedef const void* const_void_pointer; typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; private: template<class U> struct min_align { enum { value = detail::max_size<Alignment, detail::max_align<U, char_ptr>::value>::value }; }; public: template<class U> struct rebind { #if !defined(BOOST_NO_CXX11_ALLOCATOR) typedef aligned_allocator_adaptor<typename traits::template rebind_alloc<U>, Alignment> other; #else typedef aligned_allocator_adaptor<typename Allocator::template rebind<U>::other, Alignment> other; #endif }; aligned_allocator_adaptor() : Allocator() { } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template<class A> explicit aligned_allocator_adaptor(A&& alloc) BOOST_NOEXCEPT : Allocator(std::forward<A>(alloc)) { } #else template<class A> explicit aligned_allocator_adaptor(const A& alloc) BOOST_NOEXCEPT : Allocator(alloc) { } #endif template<class U> aligned_allocator_adaptor(const aligned_allocator_adaptor<U, Alignment>& other) BOOST_NOEXCEPT : Allocator(other.base()) { } Allocator& base() BOOST_NOEXCEPT { return static_cast<Allocator&>(*this); } const Allocator& base() const BOOST_NOEXCEPT { return static_cast<const Allocator&>(*this); } pointer allocate(size_type size) { enum { m = min_align<value_type>::value }; std::size_t s = size * sizeof(value_type); std::size_t n = s + m - 1; char_alloc a(base()); char_ptr p = a.allocate(sizeof p + n); void* r = boost::to_address(p) + sizeof p; (void)boost::alignment::align(m, s, r, n); ::new(static_cast<void*>(static_cast<char_ptr*>(r) - 1)) char_ptr(p); return static_cast<pointer>(r); } pointer allocate(size_type size, const_void_pointer hint) { enum { m = min_align<value_type>::value }; std::size_t s = size * sizeof(value_type); std::size_t n = s + m - 1; char_ptr h = char_ptr(); if (hint) { h = *(static_cast<const char_ptr*>(hint) - 1); } char_alloc a(base()); #if !defined(BOOST_NO_CXX11_ALLOCATOR) char_ptr p = char_traits::allocate(a, sizeof p + n, h); #else char_ptr p = a.allocate(sizeof p + n, h); #endif void* r = boost::to_address(p) + sizeof p; (void)boost::alignment::align(m, s, r, n); ::new(static_cast<void*>(static_cast<char_ptr*>(r) - 1)) char_ptr(p); return static_cast<pointer>(r); } void deallocate(pointer ptr, size_type size) { enum { m = min_align<value_type>::value }; char_ptr* p = reinterpret_cast<char_ptr*>(ptr) - 1; char_ptr r = *p; p->~char_ptr(); char_alloc a(base()); a.deallocate(r, sizeof r + size * sizeof(value_type) + m - 1); } }; template<class A, class B, std::size_t Alignment> inline bool operator==(const aligned_allocator_adaptor<A, Alignment>& a, const aligned_allocator_adaptor<B, Alignment>& b) BOOST_NOEXCEPT { return a.base() == b.base(); } template<class A, class B, std::size_t Alignment> inline bool operator!=(const aligned_allocator_adaptor<A, Alignment>& a, const aligned_allocator_adaptor<B, Alignment>& b) BOOST_NOEXCEPT { return !(a == b); } } /* alignment */ } /* boost */ #endif align_down.hpp 0000644 00000001121 15125235257 0007400 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGN_DOWN_HPP #define BOOST_ALIGN_ALIGN_DOWN_HPP #include <boost/align/detail/align_down.hpp> #include <boost/align/detail/not_pointer.hpp> namespace boost { namespace alignment { template<class T> BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type align_down(T value, std::size_t alignment) BOOST_NOEXCEPT { return T(value & ~T(alignment - 1)); } } /* alignment */ } /* boost */ #endif detail/aligned_alloc_android.hpp 0000644 00000001273 15125235257 0013006 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_ANDROID_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <malloc.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return ::memalign(alignment, size); } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::free(ptr); } } /* alignment */ } /* boost */ #endif detail/assume_aligned_intel.hpp 0000644 00000000704 15125235257 0012702 0 ustar 00 /* Copyright 2015 NumScale SAS Copyright 2015 LRI UMR 8623 CNRS/University Paris Sud XI Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_INTEL_HPP #define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_INTEL_HPP #define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ __assume_aligned((ptr), (alignment)) #endif detail/align_cxx11.hpp 0000644 00000000561 15125235257 0010646 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP #define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP #include <memory> namespace boost { namespace alignment { using std::align; } /* alignment */ } /* boost */ #endif detail/min_size.hpp 0000644 00000001042 15125235257 0010340 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_MIN_SIZE_HPP #define BOOST_ALIGN_DETAIL_MIN_SIZE_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<std::size_t A, std::size_t B> struct min_size : integral_constant<std::size_t, (A < B) ? A : B> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/integral_constant.hpp 0000644 00000002217 15125235257 0012246 0 ustar 00 /* Copyright 2014-2016 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP #define BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP #include <boost/config.hpp> #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #include <type_traits> #endif namespace boost { namespace alignment { namespace detail { #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) using std::integral_constant; using std::true_type; using std::false_type; #else template<class T, T Value> struct integral_constant { typedef T value_type; typedef integral_constant type; BOOST_CONSTEXPR operator value_type() const BOOST_NOEXCEPT { return Value; } BOOST_CONSTEXPR value_type operator()() const BOOST_NOEXCEPT { return Value; } BOOST_STATIC_CONSTEXPR T value = Value; }; template<class T, T Value> BOOST_CONSTEXPR_OR_CONST T integral_constant<T, Value>::value; typedef integral_constant<bool, true> true_type; typedef integral_constant<bool, false> false_type; #endif } /* detail */ } /* alignment */ } /* boost */ #endif detail/alignment_of_codegear.hpp 0000644 00000001046 15125235257 0013022 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CODEGEAR_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CODEGEAR_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<class T> struct alignment_of : integral_constant<std::size_t, alignof(T)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/alignment_of_gcc.hpp 0000644 00000001040 15125235257 0011777 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_GCC_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<class T> struct alignment_of : integral_constant<std::size_t, __alignof__(T)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/aligned_alloc_posix.hpp 0000644 00000001503 15125235257 0012524 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_POSIX_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_POSIX_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <stdlib.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); if (alignment < sizeof(void*)) { alignment = sizeof(void*); } void* p; if (::posix_memalign(&p, alignment, size) != 0) { p = 0; } return p; } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::free(ptr); } } /* alignment */ } /* boost */ #endif detail/max_align.hpp 0000644 00000001063 15125235257 0010465 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP #define BOOST_ALIGN_DETAIL_MAX_ALIGN_HPP #include <boost/align/detail/max_size.hpp> #include <boost/align/alignment_of.hpp> namespace boost { namespace alignment { namespace detail { template<class A, class B> struct max_align : max_size<alignment_of<A>::value, alignment_of<B>::value> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/alignment_of.hpp 0000644 00000001125 15125235257 0011167 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_HPP #include <boost/align/detail/min_size.hpp> namespace boost { namespace alignment { namespace detail { template<class T> struct offset_value { char value; T object; }; template<class T> struct alignment_of : min_size<sizeof(T), sizeof(offset_value<T>) - sizeof(T)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/assume_aligned_clang.hpp 0000644 00000000746 15125235257 0012661 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_CLANG_HPP #define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_CLANG_HPP #if __has_builtin(__builtin_assume_aligned) #define BOOST_ALIGN_ASSUME_ALIGNED(p, n) \ (p) = static_cast<__typeof__(p)>(__builtin_assume_aligned((p), (n))) #else #define BOOST_ALIGN_ASSUME_ALIGNED(p, n) #endif #endif detail/not_pointer.hpp 0000644 00000000760 15125235257 0011071 0 ustar 00 /* Copyright 2019 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_NOT_POINTER_HPP #define BOOST_ALIGN_DETAIL_NOT_POINTER_HPP namespace boost { namespace alignment { namespace detail { template<class T, class U> struct not_pointer { typedef U type; }; template<class T, class U> struct not_pointer<T*, U> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/add_reference.hpp 0000644 00000001436 15125235257 0011300 0 ustar 00 /* Copyright 2019 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ADD_REFERENCE_HPP #define BOOST_ALIGN_DETAIL_ADD_REFERENCE_HPP #include <boost/config.hpp> #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #include <type_traits> #endif namespace boost { namespace alignment { namespace detail { #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) using std::add_lvalue_reference; #else template<class T> struct add_lvalue_reference { typedef T& type; }; template<> struct add_lvalue_reference<void> { typedef void type; }; template<> struct add_lvalue_reference<const void> { typedef const void type; }; #endif } /* detail */ } /* alignment */ } /* boost */ #endif detail/aligned_alloc.hpp 0000644 00000002241 15125235257 0011302 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/align/align.hpp> #include <boost/align/alignment_of.hpp> #include <boost/assert.hpp> #include <cstdlib> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); enum { N = alignment_of<void*>::value }; if (alignment < N) { alignment = N; } std::size_t n = size + alignment - N; void* p = std::malloc(sizeof(void*) + n); if (p) { void* r = static_cast<char*>(p) + sizeof(void*); (void)boost::alignment::align(alignment, size, r, n); *(static_cast<void**>(r) - 1) = p; p = r; } return p; } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { if (ptr) { std::free(*(static_cast<void**>(ptr) - 1)); } } } /* alignment */ } /* boost */ #endif detail/aligned_alloc_msvc.hpp 0000644 00000001305 15125235257 0012332 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MSVC_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <malloc.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return ::_aligned_malloc(size, alignment); } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::_aligned_free(ptr); } } /* alignment */ } /* boost */ #endif detail/max_objects.hpp 0000644 00000001067 15125235257 0011030 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_MAX_OBJECTS_HPP #define BOOST_ALIGN_DETAIL_MAX_OBJECTS_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<class T> struct max_objects : integral_constant<std::size_t, ~static_cast<std::size_t>(0) / sizeof(T)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/alignment_of_cxx11.hpp 0000644 00000000655 15125235257 0012222 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CXX11_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CXX11_HPP #include <type_traits> namespace boost { namespace alignment { namespace detail { using std::alignment_of; } /* detail */ } /* alignment */ } /* boost */ #endif detail/assume_aligned.hpp 0000644 00000000621 15125235257 0011505 0 ustar 00 /* Copyright 2015 NumScale SAS Copyright 2015 LRI UMR 8623 CNRS/University Paris Sud XI Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_HPP #define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_HPP #define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) #endif detail/assume_aligned_msvc.hpp 0000644 00000000771 15125235257 0012543 0 ustar 00 /* Copyright 2015 NumScale SAS Copyright 2015 LRI UMR 8623 CNRS/University Paris Sud XI Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_MSVC_HPP #define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_MSVC_HPP #include <cstddef> #define BOOST_ALIGN_ASSUME_ALIGNED(ptr, alignment) \ __assume((reinterpret_cast<std::size_t>(ptr) & ((alignment) - 1)) == 0) #endif detail/is_aligned.hpp 0000644 00000001503 15125235257 0010623 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNED_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> namespace boost { namespace alignment { inline bool is_aligned(const volatile void* ptr, std::size_t alignment) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0; } inline bool is_aligned(std::size_t alignment, const volatile void* ptr) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return (reinterpret_cast<std::size_t>(ptr) & (alignment - 1)) == 0; } } /* alignment */ } /* boost */ #endif detail/is_alignment_constant.hpp 0000644 00000001103 15125235257 0013103 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_CONSTANT_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<std::size_t N> struct is_alignment_constant : integral_constant<bool, (N > 0) && ((N & (N - 1)) == 0)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/alignment_of_msvc.hpp 0000644 00000001163 15125235260 0012213 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP #include <boost/align/detail/min_size.hpp> namespace boost { namespace alignment { namespace detail { template<class T> struct offset_value { T first; char value; T second; }; template<class T> struct alignment_of : min_size<sizeof(T), sizeof(offset_value<T>) - (sizeof(T) << 1)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/align_down.hpp 0000644 00000001171 15125235260 0010641 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP #define BOOST_ALIGN_DETAIL_ALIGN_DOWN_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> namespace boost { namespace alignment { inline void* align_down(void* ptr, std::size_t alignment) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return reinterpret_cast<void*>(~(alignment - 1) & reinterpret_cast<std::size_t>(ptr)); } } /* alignment */ } /* boost */ #endif detail/alignment_of_clang.hpp 0000644 00000001042 15125235260 0012323 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CLANG_HPP #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_CLANG_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<class T> struct alignment_of : integral_constant<std::size_t, __alignof(T)> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/max_size.hpp 0000644 00000001047 15125235260 0010341 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_MAX_SIZE_HPP #define BOOST_ALIGN_DETAIL_MAX_SIZE_HPP #include <boost/align/detail/integral_constant.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { template<std::size_t A, std::size_t B> struct max_size : integral_constant<std::size_t, (A > B) ? A : B> { }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/aligned_alloc_new.hpp 0000644 00000002276 15125235260 0012155 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_NEW_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_NEW_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/align/align.hpp> #include <boost/align/alignment_of.hpp> #include <boost/assert.hpp> #include <new> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); enum { N = alignment_of<void*>::value }; if (alignment < N) { alignment = N; } std::size_t n = size + alignment - N; void* p = ::operator new(sizeof(void*) + n, std::nothrow); if (p) { void* r = static_cast<char*>(p) + sizeof(void*); (void)boost::alignment::align(alignment, size, r, n); *(static_cast<void**>(r) - 1) = p; p = r; } return p; } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { if (ptr) { ::operator delete(*(static_cast<void**>(ptr) - 1)); } } } /* alignment */ } /* boost */ #endif detail/aligned_alloc_mingw.hpp 0000644 00000001325 15125235260 0012477 0 ustar 00 /* Copyright 2020 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MINGW_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MINGW_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <malloc.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return ::__mingw_aligned_malloc(size, alignment); } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::__mingw_aligned_free(ptr); } } /* alignment */ } /* boost */ #endif detail/is_alignment.hpp 0000644 00000001047 15125235260 0011173 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP #include <boost/config.hpp> #include <cstddef> namespace boost { namespace alignment { namespace detail { BOOST_CONSTEXPR inline bool is_alignment(std::size_t value) BOOST_NOEXCEPT { return (value > 0) && ((value & (value - 1)) == 0); } } /* detail */ } /* alignment */ } /* boost */ #endif detail/throw_exception.hpp 0000644 00000001466 15125235260 0011750 0 ustar 00 /* Copyright 2019 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_THROW_EXCEPTION_HPP #define BOOST_ALIGN_DETAIL_THROW_EXCEPTION_HPP #include <boost/config.hpp> #if defined(BOOST_NO_EXCEPTIONS) #include <exception> #endif namespace boost { #if defined(BOOST_NO_EXCEPTIONS) BOOST_NORETURN void throw_exception(const std::exception&); #endif namespace alignment { namespace detail { #if !defined(BOOST_NO_EXCEPTIONS) template<class E> BOOST_NORETURN inline void throw_exception(const E& error) { throw error; } #else BOOST_NORETURN inline void throw_exception(const std::exception& error) { boost::throw_exception(error); } #endif } /* detail */ } /* alignment */ } /* boost */ #endif detail/aligned_alloc_macos.hpp 0000644 00000001560 15125235260 0012461 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_MACOS_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <stdlib.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); if (size == 0) { return 0; } if (alignment < sizeof(void*)) { alignment = sizeof(void*); } void* p; if (::posix_memalign(&p, alignment, size) != 0) { p = 0; } return p; } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::free(ptr); } } /* alignment */ } /* boost */ #endif detail/aligned_alloc_sunos.hpp 0000644 00000001267 15125235260 0012532 0 ustar 00 /* Copyright 2014 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_SUNOS_HPP #define BOOST_ALIGN_DETAIL_ALIGNED_ALLOC_SUNOS_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> #include <stdlib.h> namespace boost { namespace alignment { inline void* aligned_alloc(std::size_t alignment, std::size_t size) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return ::memalign(alignment, size); } inline void aligned_free(void* ptr) BOOST_NOEXCEPT { ::free(ptr); } } /* alignment */ } /* boost */ #endif detail/align_up.hpp 0000644 00000001205 15125235260 0010314 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_UP_HPP #define BOOST_ALIGN_DETAIL_ALIGN_UP_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> namespace boost { namespace alignment { inline void* align_up(void* ptr, std::size_t alignment) BOOST_NOEXCEPT { BOOST_ASSERT(detail::is_alignment(alignment)); return reinterpret_cast<void*>(~(alignment - 1) & (reinterpret_cast<std::size_t>(ptr) + alignment - 1)); } } /* alignment */ } /* boost */ #endif detail/element_type.hpp 0000644 00000003173 15125235260 0011216 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP #define BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP #include <boost/config.hpp> #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #include <type_traits> #else #include <cstddef> #endif namespace boost { namespace alignment { namespace detail { #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) using std::remove_reference; using std::remove_all_extents; using std::remove_cv; #else template<class T> struct remove_reference { typedef T type; }; template<class T> struct remove_reference<T&> { typedef T type; }; #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template<class T> struct remove_reference<T&&> { typedef T type; }; #endif template<class T> struct remove_all_extents { typedef T type; }; template<class T> struct remove_all_extents<T[]> { typedef typename remove_all_extents<T>::type type; }; template<class T, std::size_t N> struct remove_all_extents<T[N]> { typedef typename remove_all_extents<T>::type type; }; template<class T> struct remove_cv { typedef T type; }; template<class T> struct remove_cv<const T> { typedef T type; }; template<class T> struct remove_cv<volatile T> { typedef T type; }; template<class T> struct remove_cv<const volatile T> { typedef T type; }; #endif template<class T> struct element_type { typedef typename remove_cv<typename remove_all_extents<typename remove_reference<T>::type>::type>::type type; }; } /* detail */ } /* alignment */ } /* boost */ #endif detail/assume_aligned_gcc.hpp 0000644 00000000726 15125235260 0012321 0 ustar 00 /* Copyright 2015 NumScale SAS Copyright 2015 LRI UMR 8623 CNRS/University Paris Sud XI Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_GCC_HPP #define BOOST_ALIGN_DETAIL_ASSUME_ALIGNED_GCC_HPP #define BOOST_ALIGN_ASSUME_ALIGNED(p, n) \ (p) = static_cast<__typeof__(p)>(__builtin_assume_aligned((p), (n))) #endif detail/align.hpp 0000644 00000001612 15125235260 0007612 0 ustar 00 /* Copyright 2014-2020 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_DETAIL_ALIGN_HPP #define BOOST_ALIGN_DETAIL_ALIGN_HPP #include <boost/align/detail/is_alignment.hpp> #include <boost/assert.hpp> namespace boost { namespace alignment { inline void* align(std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space) { BOOST_ASSERT(boost::alignment::detail::is_alignment(alignment)); if (size <= space) { char* p = reinterpret_cast<char*>(~(alignment - 1) & (reinterpret_cast<std::size_t>(ptr) + alignment - 1)); std::size_t n = p - static_cast<char*>(ptr); if (n <= space - size) { ptr = p; space -= n; return p; } } return 0; } } /* alignment */ } /* boost */ #endif align_up.hpp 0000644 00000001140 15125235260 0007050 0 ustar 00 /* Copyright 2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGN_UP_HPP #define BOOST_ALIGN_ALIGN_UP_HPP #include <boost/align/detail/align_up.hpp> #include <boost/align/detail/not_pointer.hpp> namespace boost { namespace alignment { template<class T> BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type align_up(T value, std::size_t alignment) BOOST_NOEXCEPT { return T((value + (T(alignment) - 1)) & ~T(alignment - 1)); } } /* alignment */ } /* boost */ #endif align.hpp 0000644 00000000671 15125235260 0006354 0 ustar 00 /* Copyright 2014-2015 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_ALIGN_ALIGN_HPP #define BOOST_ALIGN_ALIGN_HPP #include <boost/config.hpp> #if !defined(BOOST_NO_CXX11_STD_ALIGN) && !defined(BOOST_LIBSTDCXX_VERSION) #include <boost/align/detail/align_cxx11.hpp> #else #include <boost/align/detail/align.hpp> #endif #endif
| ver. 1.6 |
Github
|
.
| PHP 8.2.30 | ??????????? ?????????: 0 |
proxy
|
phpinfo
|
???????????