6#include <bitcoin-build-config.h>
24#ifdef HAVE_MALLOPT_ARENA_MAX
40 ReplaceAll(
escaped,
"'",
"'\"'\"'");
58#ifdef HAVE_MALLOPT_ARENA_MAX
64 if (
sizeof(
void*) == 4) {
96 return std::thread::hardware_concurrency();
101 static const auto total_ram{[]() -> std::optional<uint64_t> {
104#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__illumos__) || defined(__linux__)
SteadyClock::duration GetUptime()
Monotonic uptime (not affected by system time changes).
std::optional< uint64_t > TryGetTotalRam()
Return the total RAM available on the current system, if detectable.
int GetNumCores()
Return the number of cores available on the current system.
std::string ShellEscape(const std::string &arg)
void ReplaceAll(std::string &in_out, std::string_view search, std::string_view substitute)
Replace every non-overlapping occurrence of search with substitute, treating both literally; the repl...
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.