2 // { dg-additional-options "-fexceptions -fnon-call-exceptions" }
5 typedef __SIZE_TYPE__ size_t;
7 typedef __UINT8_TYPE__ uint8_t;
8 typedef __UINT64_TYPE__ uint64_t;
10 template <typename _Tp, _Tp __v> struct integral_constant {
11 static constexpr _Tp value = __v;
13 template <bool __v> using __bool_constant = integral_constant<bool, __v>;
14 template <bool> struct __conditional {
15 template <typename _Tp, typename> using type = _Tp;
17 template <bool _Cond, typename _If, typename _Else>
18 using __conditional_t = typename __conditional<_Cond>::type<_If, _Else>;
19 template <typename...> struct __and_;
20 template <typename _B1, typename _B2>
21 struct __and_<_B1, _B2> : __conditional_t<_B1::value, _B2, _B1> {};
22 template <typename> struct __not_ : __bool_constant<!bool()> {};
23 template <typename _Tp>
24 struct __is_constructible_impl : __bool_constant<__is_constructible(_Tp)> {};
25 template <typename _Tp>
26 struct is_default_constructible : __is_constructible_impl<_Tp> {};
27 template <typename _Tp> struct remove_extent { typedef _Tp type; };
28 template <bool> struct enable_if;
31 template <typename _Tp> struct allocator_traits { using pointer = _Tp; };
32 template <typename _Alloc> struct __alloc_traits : allocator_traits<_Alloc> {};
33 template <typename, typename _Alloc> struct _Vector_base {
34 typedef typename __alloc_traits<_Alloc>::pointer pointer;
37 pointer _M_end_of_storage;
40 template <typename _Tp, typename _Alloc = _Tp>
41 class vector : _Vector_base<_Tp, _Alloc> {
44 typedef size_t size_type;
46 template <typename _Tp, typename _Dp> class __uniq_ptr_impl {
47 template <typename _Up, typename> struct _Ptr { using type = _Up *; };
50 using _DeleterConstraint =
51 enable_if<__and_<__not_<_Dp>, is_default_constructible<_Dp>>::value>;
52 using pointer = typename _Ptr<_Tp, _Dp>::type;
54 template <typename _Tp, typename _Dp = _Tp> class unique_ptr {
56 using pointer = typename __uniq_ptr_impl<_Tp, _Dp>::pointer;
59 enum _Lock_policy { _S_atomic } const __default_lock_policy = _S_atomic;
60 template <_Lock_policy = __default_lock_policy> class _Sp_counted_base;
61 template <typename, _Lock_policy = __default_lock_policy> class __shared_ptr;
62 template <_Lock_policy> class __shared_count { _Sp_counted_base<> *_M_pi; };
63 template <typename _Tp, _Lock_policy _Lp> class __shared_ptr {
64 using element_type = typename remove_extent<_Tp>::type;
66 __shared_count<_Lp> _M_refcount;
68 template <typename _Tp> class shared_ptr : __shared_ptr<_Tp> {
70 shared_ptr() noexcept : __shared_ptr<_Tp>() {}
72 enum CompressionType : char;
74 enum Temperature : uint8_t;
75 struct MutableCFOptions {
77 : soft_pending_compaction_bytes_limit(),
78 hard_pending_compaction_bytes_limit(level0_file_num_compaction_trigger),
79 level0_slowdown_writes_trigger(level0_stop_writes_trigger),
80 max_compaction_bytes(target_file_size_base),
81 target_file_size_multiplier(max_bytes_for_level_base),
82 max_bytes_for_level_multiplier(ttl), compaction_options_fifo(),
83 min_blob_size(blob_file_size), blob_compression_type(),
84 enable_blob_garbage_collection(blob_garbage_collection_age_cutoff),
85 max_sequential_skip_in_iterations(check_flush_compaction_key_order),
86 paranoid_file_checks(bottommost_compression), bottommost_temperature(),
87 sample_for_compression() {}
88 shared_ptr<SliceTransform> prefix_extractor;
89 uint64_t soft_pending_compaction_bytes_limit;
90 uint64_t hard_pending_compaction_bytes_limit;
91 int level0_file_num_compaction_trigger;
92 int level0_slowdown_writes_trigger;
93 int level0_stop_writes_trigger;
94 uint64_t max_compaction_bytes;
95 uint64_t target_file_size_base;
96 int target_file_size_multiplier;
97 uint64_t max_bytes_for_level_base;
98 double max_bytes_for_level_multiplier;
100 vector<int> compaction_options_fifo;
101 uint64_t min_blob_size;
102 uint64_t blob_file_size;
103 CompressionType blob_compression_type;
104 bool enable_blob_garbage_collection;
105 double blob_garbage_collection_age_cutoff;
106 uint64_t max_sequential_skip_in_iterations;
107 bool check_flush_compaction_key_order;
108 bool paranoid_file_checks;
109 CompressionType bottommost_compression;
110 Temperature bottommost_temperature;
111 uint64_t sample_for_compression;
113 template <class T, size_t kSize = 8> class autovector {
114 using value_type = T;
115 using size_type = typename vector<T>::size_type;
116 size_type buf_[kSize * sizeof(value_type)];
119 class ColumnFamilyData;
120 struct SuperVersion {
121 MutableCFOptions write_stall_condition;
122 autovector<MemTable *> to_delete;
124 class ColumnFamilySet {
128 iterator operator++();
129 bool operator!=(iterator);
130 ColumnFamilyData *operator*();
131 ColumnFamilyData *current_;
138 ColumnFamilySet *GetColumnFamilySet();
140 struct SuperVersionContext {
141 void NewSuperVersion() { new SuperVersion(); }
144 unique_ptr<VersionSet> versions_;
145 void InstallSuperVersionAndScheduleWork(ColumnFamilyData *,
146 SuperVersionContext *,
147 const MutableCFOptions &);
149 void DBImpl::InstallSuperVersionAndScheduleWork(ColumnFamilyData *,
150 SuperVersionContext *sv_context,
151 const MutableCFOptions &) {
152 sv_context->NewSuperVersion();
153 for (auto my_cfd : *versions_->GetColumnFamilySet())