diff --git a/ircd/db.cc b/ircd/db.cc index f4a601316..99f59abb5 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1910,7 +1910,7 @@ ircd::db::database::column::column(database &d, ,allocator { #ifdef IRCD_DB_HAS_ALLOCATOR - std::make_shared(this->d, this) + std::make_shared(this->d, this) #endif } ,handle @@ -3071,21 +3071,19 @@ ircd::db::database::cache::cache(database *const &d, ,name{std::move(name)} ,stats{std::move(stats)} ,allocator{std::move(allocator)} -,c +,c{rocksdb::NewLRUCache(rocksdb::LRUCacheOptions { - rocksdb::NewLRUCache - ( - std::max(initial_capacity, ssize_t(0)) - ,DEFAULT_SHARD_BITS - ,DEFAULT_STRICT - ,DEFAULT_HI_PRIO - #ifdef IRCD_DB_HAS_ALLOCATOR - ,d->allocator - #endif - ) -} + size_t(std::max(initial_capacity, ssize_t(0))) + ,DEFAULT_SHARD_BITS + ,DEFAULT_STRICT + ,DEFAULT_HI_PRIO + #ifdef IRCD_DB_HAS_ALLOCATOR + ,this->allocator + #endif +})} { assert(bool(c)); + assert(c->memory_allocator() == this->allocator.get()); } ircd::db::database::cache::~cache() diff --git a/ircd/db_database.h b/ircd/db_database.h index 53cd33b67..5c260aa0f 100644 --- a/ircd/db_database.h +++ b/ircd/db_database.h @@ -42,7 +42,7 @@ struct ircd::db::database::cache final using callback = void (*)(void *, size_t); using Statistics = rocksdb::Statistics; - static const ssize_t DEFAULT_SHARD_BITS; + static const int DEFAULT_SHARD_BITS; static const double DEFAULT_HI_PRIO; static const bool DEFAULT_STRICT; @@ -293,7 +293,7 @@ struct ircd::db::database::wal_filter #ifdef IRCD_DB_HAS_ALLOCATOR /// Dynamic memory -struct ircd::db::database::allocator +struct ircd::db::database::allocator final :rocksdb::MemoryAllocator { database *d {nullptr};