0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 13:38:55 +02:00

ircd::allocator::je: Add runtime query for linked library at initialization.

This commit is contained in:
Jason Volk 2020-05-10 18:38:20 -07:00
parent 708bba4bf9
commit aae7f7e545
2 changed files with 15 additions and 0 deletions

View file

@ -46,6 +46,13 @@ namespace ircd::allocator
bool trim(const size_t &pad = 0) noexcept; // malloc_trim(3)
}
/// jemalloc specific suite; note that some of the primary ircd::allocator
/// interface has different functionality when je::available.
namespace ircd::allocator::je
{
extern const bool available;
}
/// Valgrind memcheck hypercall suite
/// note: definitions located in ircd/vg.cc
namespace ircd::allocator::vg

View file

@ -53,6 +53,14 @@ ircd::allocator::je::malloc_version_abi
"jemalloc", info::versions::ABI, //TODO: get this
};
decltype(ircd::allocator::je::available)
ircd::allocator::je::available
{
#if defined(IRCD_ALLOCATOR_JEMALLOC)
mods::ldso::has("jemalloc")
#endif
};
#if defined(IRCD_ALLOCATOR_JEMALLOC)
bool
ircd::allocator::trim(const size_t &pad)