40-deque.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/include/deque b/include/deque
  2. index 6b6d8e2..951bab9 100644
  3. --- a/include/deque
  4. +++ b/include/deque
  5. @@ -249,7 +249,9 @@ template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TEMPLATE_
  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, class _Pointer, class _Reference, class _MapPointer,
  14. @@ -853,7 +855,7 @@ public:
  15. _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
  16. __is_nothrow_swappable<allocator_type>::value);
  17. #endif
  18. - _LIBCPP_HIDE_FROM_ABI
  19. + _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI
  20. void clear() _NOEXCEPT;
  21. _LIBCPP_HIDE_FROM_ABI
  22. @@ -2836,6 +2838,7 @@ deque<_Tp, _Allocator>::swap(deque& __c)
  23. }
  24. template <class _Tp, class _Allocator>
  25. +_LIBCPP_REINITIALIZES_OBJECT
  26. inline
  27. void
  28. deque<_Tp, _Allocator>::clear() _NOEXCEPT