Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from eddelbuettel/feature/boost-1.64
- Loading branch information
Showing
1,305 changed files
with
169,568 additions
and
12,295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
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_HPP | ||
#define BOOST_ALIGN_HPP | ||
|
||
#include <boost/align/align.hpp> | ||
#include <boost/align/align_down.hpp> | ||
#include <boost/align/align_up.hpp> | ||
#include <boost/align/aligned_alloc.hpp> | ||
#include <boost/align/aligned_allocator.hpp> | ||
#include <boost/align/aligned_allocator_adaptor.hpp> | ||
#include <boost/align/aligned_delete.hpp> | ||
#include <boost/align/alignment_of.hpp> | ||
#include <boost/align/assume_aligned.hpp> | ||
#include <boost/align/is_aligned.hpp> | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
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> | ||
|
||
namespace boost { | ||
namespace alignment { | ||
|
||
BOOST_CONSTEXPR inline std::size_t | ||
align_down(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT | ||
{ | ||
return value & ~(alignment - 1); | ||
} | ||
|
||
} /* alignment */ | ||
} /* boost */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
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> | ||
|
||
namespace boost { | ||
namespace alignment { | ||
|
||
BOOST_CONSTEXPR inline std::size_t | ||
align_up(std::size_t value, std::size_t alignment) BOOST_NOEXCEPT | ||
{ | ||
return (value + alignment - 1) & ~(alignment - 1); | ||
} | ||
|
||
} /* alignment */ | ||
} /* boost */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
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_ALLOCATE) | ||
#include <boost/align/detail/aligned_alloc.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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
/* | ||
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/addressof.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/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) | ||
#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 std::size_t size_type; | ||
typedef std::ptrdiff_t difference_type; | ||
typedef T& reference; | ||
typedef const T& const_reference; | ||
|
||
private: | ||
enum { | ||
min_align = detail::max_size<Alignment, | ||
alignment_of<value_type>::value>::value | ||
}; | ||
|
||
public: | ||
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 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) { | ||
if (size == 0) { | ||
return 0; | ||
} | ||
void* p = aligned_alloc(min_align, sizeof(T) * size); | ||
if (!p) { | ||
boost::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); | ||
} | ||
#endif | ||
|
||
template<class U> | ||
void construct(U* ptr) { | ||
::new((void*)ptr) U(); | ||
} | ||
|
||
template<class U> | ||
void destroy(U* ptr) { | ||
(void)ptr; | ||
ptr->~U(); | ||
} | ||
}; | ||
|
||
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>&, | ||
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 |
Oops, something went wrong.