blob: a4c0fd5d53ba211ec4ddd5a1e504d9274762d6d8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
diff --git a/include/deque b/include/deque
index 4fc994a..fc0e1ad 100644
--- a/include/deque
+++ b/include/deque
@@ -248,7 +248,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _ValueType, class _DiffType>
struct __deque_block_size {
- static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
+ static const _DiffType __buf_size = 64 * sizeof(void*);
+ static const _DiffType value = (__buf_size / sizeof(_ValueType)) > 2 ? (__buf_size / sizeof(_ValueType)) : 2;
+ // static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16;
};
template <class _ValueType,
@@ -804,7 +806,7 @@ public:
#else
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<allocator_type>);
#endif
- _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
+ _LIBCPP_REINITIALIZES_OBJECT _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT;
_LIBCPP_HIDE_FROM_ABI bool __invariants() const {
if (!__map_.__invariants())
@@ -2471,7 +2473,7 @@ inline void deque<_Tp, _Allocator>::swap(deque& __c)
}
template <class _Tp, class _Allocator>
-inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
+_LIBCPP_REINITIALIZES_OBJECT inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
__annotate_delete();
allocator_type& __a = __alloc();
for (iterator __i = begin(), __e = end(); __i != __e; ++__i)
|