diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-09-07 18:46:40 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-09-07 18:46:40 +0300 |
commit | c82995f3e67ed1947c29fa1d27f1dfe015513ab0 (patch) | |
tree | 56e073404b7a694a6bb72c6eaa7fc3a0facdda94 /indra/llcommon/llsys.cpp | |
parent | 59fc1ce288cf11839f4967c50bd1dedb2fde378d (diff) |
SL-15832 Add OS bitness to ViewerStats
Diffstat (limited to 'indra/llcommon/llsys.cpp')
-rw-r--r-- | indra/llcommon/llsys.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 4e61fb8a58..b3a93e3254 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -474,6 +474,8 @@ LLOSInfo::LLOSInfo() : dotted_version_string << mMajorVer << "." << mMinorVer << "." << mBuild; mOSVersionString.append(dotted_version_string.str()); + mOSBitness = is64Bit() ? 64 : 32; + LL_INFOS("LLOSInfo") << "OS bitness: " << mOSBitness << LL_ENDL; } #ifndef LL_WINDOWS @@ -529,6 +531,11 @@ const std::string& LLOSInfo::getOSVersionString() const return mOSVersionString; } +const S32 LLOSInfo::getOSBitness() const +{ + return mOSBitness; +} + //static U32 LLOSInfo::getProcessVirtualSizeKB() { @@ -582,6 +589,25 @@ U32 LLOSInfo::getProcessResidentSizeKB() return resident_size; } +//static +bool LLOSInfo::is64Bit() +{ +#if LL_WINDOWS +#if defined(_WIN64) + return true; +#elif defined(_WIN32) + // 32-bit viewer may be run on both 32-bit and 64-bit Windows, need to elaborate + BOOL f64 = FALSE; + return IsWow64Process(GetCurrentProcess(), &f64) && f64; +#else + return false; +#endif +#else // ! LL_WINDOWS + // we only build a 64-bit mac viewer and currently we don't build for linux at all + return true; +#endif +} + LLCPUInfo::LLCPUInfo() { std::ostringstream out; |