diff --git a/include/ircd/db/database/env/env.h b/include/ircd/db/database/env/env.h index 385d3199f..bcbf49f1b 100644 --- a/include/ircd/db/database/env/env.h +++ b/include/ircd/db/database/env/env.h @@ -26,6 +26,7 @@ struct ircd::db::database::env final struct random_rw_file; struct directory; struct file_lock; + struct state; using Status = rocksdb::Status; using EnvOptions = rocksdb::EnvOptions; @@ -45,6 +46,8 @@ struct ircd::db::database::env final *rocksdb::Env::Default() }; + std::unique_ptr st; + Status NewSequentialFile(const std::string& f, std::unique_ptr* r, const EnvOptions& options) noexcept override; Status NewRandomAccessFile(const std::string& f, std::unique_ptr* r, const EnvOptions& options) noexcept override; Status NewWritableFile(const std::string& f, std::unique_ptr* r, const EnvOptions& options) noexcept override; diff --git a/include/ircd/db/database/env/state.h b/include/ircd/db/database/env/state.h new file mode 100644 index 000000000..51071f93b --- /dev/null +++ b/include/ircd/db/database/env/state.h @@ -0,0 +1,20 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2018 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#pragma once +#define HAVE_IRCD_DB_DATABASE_ENV_STATE_H + +struct ircd::db::database::env::state +{ + database &d; + + state(database *const &d); + ~state() noexcept; +}; diff --git a/ircd/db.cc b/ircd/db.cc index 708d1513b..00a32e90b 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -44,6 +44,8 @@ #include #include #include +#include + // RocksDB port linktime-overriding interfaces (experimental). #ifdef IRCD_DB_PORT @@ -1742,7 +1744,8 @@ noexcept // ircd::db::database::env::env(database *const &d) -:d{*d} +:d{*d}, +st{std::make_unique(d)} { } @@ -3242,6 +3245,21 @@ rocksdb::port::CondVar::SignalAll() #endif // IRCD_DB_PORT +/////////////////////////////////////////////////////////////////////////////// +// +// db/database/env/state.h +// + +ircd::db::database::env::state::state(database *const &d) +:d{*d} +{ +} + +ircd::db::database::env::state::~state() +noexcept +{ +} + /////////////////////////////////////////////////////////////////////////////// // // db/txn.h