40-deque.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. diff --git a/include/deque b/include/deque
  2. index 85ea9c6..2c6773a 100644
  3. --- a/include/deque
  4. +++ b/include/deque
  5. @@ -249,7 +249,9 @@ class _LIBCPP_TEMPLATE_VIS deque;
  6. template <class _ValueType, class _DiffType>
  7. struct __deque_block_size {
  8. - static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
  9. + static const _DiffType __buf_size = 64 * sizeof(void*);
  10. + static const _DiffType value = (__buf_size / sizeof(_ValueType)) > 2 ? (__buf_size / sizeof(_ValueType)) : 2;
  11. + // static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
  12. };
  13. template <class _ValueType,
  14. @@ -798,7 +800,7 @@ public:
  15. #else
  16. _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable<allocator_type>::value);
  17. #endif
  18. - _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
  19. + _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
  20. _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
  21. if (!__map_.__invariants())
  22. @@ -2494,7 +2496,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c)
  23. }
  24. template <class _Tp, class _Allocator>
  25. -inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
  26. +_LIBCPP_REINITIALIZES_OBJECT inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
  27. __annotate_delete();
  28. allocator_type& __a = __alloc();
  29. for (iterator __i = begin(), __e = end(); __i != __e; ++__i)