6#include <bitcoin-build-config.h>
24#ifdef HAVE_MALLOPT_ARENA_MAX
44 ReplaceAll(
escaped,
"'",
"'\"'\"'");
66#ifdef HAVE_MALLOPT_ARENA_MAX
72 if (
sizeof(
void*) == 4) {
78#if !defined(WIN32) && !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
81 }
catch (
const std::runtime_error&) {
82 setenv(
"LC_ALL",
"C.UTF-8", 1);
111 return std::thread::hardware_concurrency();
119#elif defined(__APPLE__) || \
120 defined(__FreeBSD__) || \
121 defined(__NetBSD__) || \
122 defined(__OpenBSD__) || \
123 defined(__illumos__) || \
std::optional< size_t > GetTotalRAM()
Return the total RAM available on the current system, if detectable.
SteadyClock::duration GetUptime()
Monotonic uptime (not affected by system time changes).
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, const std::string &search, const std::string &substitute)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.