update boost
This commit is contained in:
@@ -10,7 +10,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_STD_ALIGN)
|
||||
#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>
|
||||
|
||||
@@ -9,14 +9,16 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#define BOOST_ALIGN_ALIGN_DOWN_HPP
|
||||
|
||||
#include <boost/align/detail/align_down.hpp>
|
||||
#include <boost/align/detail/not_pointer.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace alignment {
|
||||
|
||||
BOOST_CONSTEXPR inline std::size_t
|
||||
align_down(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type
|
||||
align_down(T value, std::size_t alignment) BOOST_NOEXCEPT
|
||||
{
|
||||
return value & ~(alignment - 1);
|
||||
return T(value & ~T(alignment - 1));
|
||||
}
|
||||
|
||||
} /* alignment */
|
||||
|
||||
@@ -9,14 +9,16 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#define BOOST_ALIGN_ALIGN_UP_HPP
|
||||
|
||||
#include <boost/align/detail/align_up.hpp>
|
||||
#include <boost/align/detail/not_pointer.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace alignment {
|
||||
|
||||
BOOST_CONSTEXPR inline std::size_t
|
||||
align_up(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR inline typename detail::not_pointer<T, T>::type
|
||||
align_up(T value, std::size_t alignment) BOOST_NOEXCEPT
|
||||
{
|
||||
return (value + alignment - 1) & ~(alignment - 1);
|
||||
return T((value + (T(alignment) - 1)) & ~T(alignment - 1));
|
||||
}
|
||||
|
||||
} /* alignment */
|
||||
|
||||
@@ -18,12 +18,16 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <AvailabilityMacros.h>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_ALIGN_USE_ALLOCATE)
|
||||
#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
|
||||
@@ -34,7 +38,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#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)
|
||||
#elif defined(_POSIX_VERSION)
|
||||
#include <boost/align/detail/aligned_alloc_posix.hpp>
|
||||
#else
|
||||
#include <boost/align/detail/aligned_alloc.hpp>
|
||||
|
||||
@@ -8,15 +8,15 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#ifndef BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP
|
||||
#define BOOST_ALIGN_ALIGNED_ALLOCATOR_HPP
|
||||
|
||||
#include <boost/align/detail/addressof.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 <boost/throw_exception.hpp>
|
||||
#include <new>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
@@ -36,10 +36,13 @@ public:
|
||||
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 T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef detail::true_type propagate_on_container_move_assignment;
|
||||
typedef detail::true_type is_always_equal;
|
||||
|
||||
template<class U>
|
||||
struct rebind {
|
||||
@@ -56,14 +59,6 @@ public:
|
||||
aligned_allocator(const aligned_allocator<U, Alignment>&)
|
||||
BOOST_NOEXCEPT { }
|
||||
|
||||
pointer address(reference value) const BOOST_NOEXCEPT {
|
||||
return detail::addressof(value);
|
||||
}
|
||||
|
||||
const_pointer address(const_reference value) const BOOST_NOEXCEPT {
|
||||
return detail::addressof(value);
|
||||
}
|
||||
|
||||
pointer allocate(size_type size, const_void_pointer = 0) {
|
||||
enum {
|
||||
m = detail::max_size<Alignment,
|
||||
@@ -74,7 +69,7 @@ public:
|
||||
}
|
||||
void* p = boost::alignment::aligned_alloc(m, sizeof(T) * size);
|
||||
if (!p) {
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
detail::throw_exception(std::bad_alloc());
|
||||
}
|
||||
return static_cast<T*>(p);
|
||||
}
|
||||
@@ -104,6 +99,11 @@ public:
|
||||
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>
|
||||
@@ -118,21 +118,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<std::size_t Alignment>
|
||||
class aligned_allocator<void, Alignment> {
|
||||
BOOST_STATIC_ASSERT(detail::is_alignment_constant<Alignment>::value);
|
||||
|
||||
public:
|
||||
typedef void value_type;
|
||||
typedef void* pointer;
|
||||
typedef const void* const_pointer;
|
||||
|
||||
template<class U>
|
||||
struct rebind {
|
||||
typedef aligned_allocator<U, Alignment> other;
|
||||
};
|
||||
};
|
||||
|
||||
template<class T, class U, std::size_t Alignment>
|
||||
inline bool
|
||||
operator==(const aligned_allocator<T, Alignment>&,
|
||||
|
||||
@@ -74,12 +74,8 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
aligned_allocator_adaptor() = default;
|
||||
#else
|
||||
aligned_allocator_adaptor()
|
||||
: Allocator() { }
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template<class A>
|
||||
|
||||
@@ -11,7 +11,9 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/align/detail/element_type.hpp>
|
||||
#include <boost/align/alignment_of_forward.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#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>
|
||||
@@ -21,7 +23,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#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(__CODEGEARC__)
|
||||
#elif defined(BOOST_CODEGEARC)
|
||||
#include <boost/align/detail/alignment_of_codegear.hpp>
|
||||
#elif defined(BOOST_CLANG)
|
||||
#include <boost/align/detail/alignment_of_clang.hpp>
|
||||
|
||||
44
linx64/include/boost/align/detail/add_reference.hpp
Normal file
44
linx64/include/boost/align/detail/add_reference.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
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_ADDRESSOF_HPP
|
||||
#define BOOST_ALIGN_DETAIL_ADDRESSOF_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ADDRESSOF)
|
||||
#include <memory>
|
||||
#else
|
||||
#include <boost/core/addressof.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace alignment {
|
||||
namespace detail {
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_ADDRESSOF)
|
||||
using std::addressof;
|
||||
#else
|
||||
using boost::addressof;
|
||||
#endif
|
||||
|
||||
} /* detail */
|
||||
} /* alignment */
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2014-2016 Glen Joseph Fernandes
|
||||
Copyright 2014-2020 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
@@ -18,14 +18,14 @@ inline void*
|
||||
align(std::size_t alignment, std::size_t size, void*& ptr,
|
||||
std::size_t& space)
|
||||
{
|
||||
BOOST_ASSERT(detail::is_alignment(alignment));
|
||||
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 = space - (p - static_cast<char*>(ptr));
|
||||
if (size <= n) {
|
||||
std::size_t n = p - static_cast<char*>(ptr);
|
||||
if (n <= space - size) {
|
||||
ptr = p;
|
||||
space = n;
|
||||
space -= n;
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
34
linx64/include/boost/align/detail/aligned_alloc_mingw.hpp
Normal file
34
linx64/include/boost/align/detail/aligned_alloc_mingw.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
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
|
||||
52
linx64/include/boost/align/detail/aligned_alloc_new.hpp
Normal file
52
linx64/include/boost/align/detail/aligned_alloc_new.hpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
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
|
||||
@@ -20,6 +20,8 @@ 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 {
|
||||
@@ -39,6 +41,9 @@ struct integral_constant {
|
||||
|
||||
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 */
|
||||
|
||||
@@ -15,14 +15,14 @@ namespace boost {
|
||||
namespace alignment {
|
||||
|
||||
inline bool
|
||||
is_aligned(const void* ptr, std::size_t alignment) BOOST_NOEXCEPT
|
||||
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 void* ptr) BOOST_NOEXCEPT
|
||||
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;
|
||||
|
||||
27
linx64/include/boost/align/detail/not_pointer.hpp
Normal file
27
linx64/include/boost/align/detail/not_pointer.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
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
|
||||
44
linx64/include/boost/align/detail/throw_exception.hpp
Normal file
44
linx64/include/boost/align/detail/throw_exception.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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
|
||||
@@ -10,14 +10,16 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#define BOOST_ALIGN_IS_ALIGNED_HPP
|
||||
|
||||
#include <boost/align/detail/is_aligned.hpp>
|
||||
#include <boost/align/detail/not_pointer.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace alignment {
|
||||
|
||||
BOOST_CONSTEXPR inline bool
|
||||
is_aligned(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT
|
||||
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 & (alignment - 1)) == 0;
|
||||
return (value & (T(alignment) - 1)) == 0;
|
||||
}
|
||||
|
||||
} /* alignment */
|
||||
|
||||
Reference in New Issue
Block a user