diff --git a/ircd/db.cc b/ircd/db.cc index 3a110a340..fe06bb56c 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -8,6 +8,7 @@ // copyright notice and this permission notice is present in all copies. The // full license for this software is available in the LICENSE file. +#include 0UL); + assert(size < 256_GiB); + + const auto ptr { - ircd::allocator::aligned_alloc(alignment, size) + #ifdef IRCD_ALLOCATOR_USE_JEMALLOC + mallocx(size, arena_flags) + #else + ircd::allocator::aligned_alloc(alignment, size).release() + #endif }; #ifdef RB_DEBUG_DB_ENV @@ -3565,11 +3592,11 @@ noexcept c? string_view(db::name(*c)): string_view{}, size, alignment, - ptr.get(), + ptr, }; #endif - return ptr.release(); + return ptr; } const char * diff --git a/ircd/db_database.h b/ircd/db_database.h index f6e05b831..0437cfaf3 100644 --- a/ircd/db_database.h +++ b/ircd/db_database.h @@ -300,6 +300,8 @@ struct ircd::db::database::allocator final database *d {nullptr}; database::column *c {nullptr}; size_t alignment {ALIGN_DEFAULT}; + unsigned arena {0}; + signed arena_flags{0}; const char *Name() const noexcept override; void *Allocate(size_t) noexcept override; @@ -308,6 +310,7 @@ struct ircd::db::database::allocator final allocator(database *const &, database::column *const & = nullptr, + const unsigned &arena = 0, const size_t &alignment = ALIGN_DEFAULT); ~allocator() noexcept;