File tree Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Expand file tree Collapse file tree 2 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,26 @@ BerkeleyEnvironment::BerkeleyEnvironment() : m_use_shared_memory(false)
232
232
fMockDb = true ;
233
233
}
234
234
235
+ /* * RAII class that automatically cleanses its data on destruction */
236
+ class SafeDbt final
237
+ {
238
+ Dbt m_dbt;
239
+
240
+ public:
241
+ // construct Dbt with internally-managed data
242
+ SafeDbt ();
243
+ // construct Dbt with provided data
244
+ SafeDbt (void * data, size_t size);
245
+ ~SafeDbt ();
246
+
247
+ // delegate to Dbt
248
+ const void * get_data () const ;
249
+ uint32_t get_size () const ;
250
+
251
+ // conversion operator to access the underlying Dbt
252
+ operator Dbt*();
253
+ };
254
+
235
255
SafeDbt::SafeDbt ()
236
256
{
237
257
m_dbt.set_flags (DB_DBT_MALLOC);
Original file line number Diff line number Diff line change @@ -152,26 +152,6 @@ class BerkeleyDatabase : public WalletDatabase
152
152
std::unique_ptr<DatabaseBatch> MakeBatch (bool flush_on_close = true ) override ;
153
153
};
154
154
155
- /* * RAII class that automatically cleanses its data on destruction */
156
- class SafeDbt final
157
- {
158
- Dbt m_dbt;
159
-
160
- public:
161
- // construct Dbt with internally-managed data
162
- SafeDbt ();
163
- // construct Dbt with provided data
164
- SafeDbt (void * data, size_t size);
165
- ~SafeDbt ();
166
-
167
- // delegate to Dbt
168
- const void * get_data () const ;
169
- uint32_t get_size () const ;
170
-
171
- // conversion operator to access the underlying Dbt
172
- operator Dbt*();
173
- };
174
-
175
155
class BerkeleyCursor : public DatabaseCursor
176
156
{
177
157
private:
You can’t perform that action at this time.
0 commit comments