#ifndef BASE_SYSTEM_SYS_INFO_INTERNAL_H_
#define BASE_SYSTEM_SYS_INFO_INTERNAL_H_
#include "base/base_export.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_APPLE)
#include <optional>
#endif
namespace base {
namespace internal {
template <typename T, T (*F)(void)>
class LazySysInfoValue {
public:
LazySysInfoValue() : value_(F()) {}
LazySysInfoValue(const LazySysInfoValue&) = delete;
LazySysInfoValue& operator=(const LazySysInfoValue&) = delete;
~LazySysInfoValue() = default;
T value() { return value_; }
private:
const T value_;
};
#if BUILDFLAG(IS_MAC)
BASE_EXPORT std::optional<int> NumberOfPhysicalProcessors();
std::optional<int> NumberOfProcessorsWhenCpuSecurityMitigationEnabled();
#endif
#if BUILDFLAG(IS_APPLE)
std::optional<int> GetSysctlIntValue(const char* key_name);
#endif
}
}
#endif