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 | |
parent | 59fc1ce288cf11839f4967c50bd1dedb2fde378d (diff) |
SL-15832 Add OS bitness to ViewerStats
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llsys.cpp | 26 | ||||
-rw-r--r-- | indra/llcommon/llsys.h | 4 |
2 files changed, 30 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; diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index 5ab97939b9..cb92cb0ac6 100644 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -51,6 +51,8 @@ public: const std::string& getOSStringSimple() const; const std::string& getOSVersionString() const; + + const S32 getOSBitness() const; S32 mMajorVer; S32 mMinorVer; @@ -59,6 +61,7 @@ public: #ifndef LL_WINDOWS static S32 getMaxOpenFiles(); #endif + static bool is64Bit(); static U32 getProcessVirtualSizeKB(); static U32 getProcessResidentSizeKB(); @@ -66,6 +69,7 @@ private: std::string mOSString; std::string mOSStringSimple; std::string mOSVersionString; + S32 mOSBitness; }; |