mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::db::database: Use scoped tag; fix allocator passed to cache; LRUCacheOptions; final override.
This commit is contained in:
parent
2c7f81d1e1
commit
15cd10f843
2 changed files with 13 additions and 15 deletions
24
ircd/db.cc
24
ircd/db.cc
|
@ -1910,7 +1910,7 @@ ircd::db::database::column::column(database &d,
|
|||
,allocator
|
||||
{
|
||||
#ifdef IRCD_DB_HAS_ALLOCATOR
|
||||
std::make_shared<struct allocator>(this->d, this)
|
||||
std::make_shared<struct database::allocator>(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()
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in a new issue