summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNicky <nicky.dasmijn@gmail.com>2022-04-18 19:57:34 +0200
committerNicky <nicky.dasmijn@gmail.com>2022-04-18 19:57:34 +0200
commitca839307f9edb5f5b6807a2a7185733518c241cf (patch)
treeabec0f3c2b8aa5a8f821f306e19b5a54599a275f /indra/llcommon
parent2b151e0aefd54671e1be504269f10318d303dccb (diff)
parentdbb044e9bb1c3d155ceb6736e2d6c9c1360b4882 (diff)
Merge remote-tracking branch 'origin/DRTVWR-543-maint' into DRTVWR-543-maint_cmake
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llcoros.cpp27
-rw-r--r--indra/llcommon/lleventcoro.cpp2
-rw-r--r--indra/llcommon/llsdutil.cpp7
-rw-r--r--indra/llcommon/llsdutil.h4
-rw-r--r--indra/llcommon/llsys.cpp28
5 files changed, 40 insertions, 28 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 75fc0fec99..c2d353b0fc 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -249,14 +249,25 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl
// protected_fixedsize_stack sets a guard page past the end of the new
// stack so that stack underflow will result in an access violation
// instead of weird, subtle, possibly undiagnosed memory stomps.
- boost::fibers::fiber newCoro(boost::fibers::launch::dispatch,
- std::allocator_arg,
- boost::fibers::protected_fixedsize_stack(mStackSize),
- [this, &name, &callable](){ toplevel(name, callable); });
- // You have two choices with a fiber instance: you can join() it or you
- // can detach() it. If you try to destroy the instance before doing
- // either, the program silently terminates. We don't need this handle.
- newCoro.detach();
+
+ try
+ {
+ boost::fibers::fiber newCoro(boost::fibers::launch::dispatch,
+ std::allocator_arg,
+ boost::fibers::protected_fixedsize_stack(mStackSize),
+ [this, &name, &callable]() { toplevel(name, callable); });
+
+ // You have two choices with a fiber instance: you can join() it or you
+ // can detach() it. If you try to destroy the instance before doing
+ // either, the program silently terminates. We don't need this handle.
+ newCoro.detach();
+ }
+ catch (std::bad_alloc&)
+ {
+ // Out of memory on stack allocation?
+ LL_ERRS("LLCoros") << "Bad memory allocation in LLCoros::launch(" << prefix << ")!" << LL_ENDL;
+ }
+
return name;
}
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index 995356dc52..067b5e6fbc 100644
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -101,7 +101,7 @@ void storeToLLSDPath(LLSD& dest, const LLSD& path, const LLSD& value)
}
// Drill down to where we should store 'value'.
- llsd::drill(dest, path) = value;
+ llsd::drill_ref(dest, path) = value;
}
} // anonymous
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index eb3a96b133..fc10fcece3 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -29,6 +29,7 @@
#include "linden_common.h"
#include "llsdutil.h"
+#include <sstream>
#if LL_WINDOWS
# define WIN32_LEAN_AND_MEAN
@@ -862,7 +863,7 @@ bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits)
namespace llsd
{
-LLSD& drill(LLSD& blob, const LLSD& rawPath)
+LLSD& drill_ref(LLSD& blob, const LLSD& rawPath)
{
// Treat rawPath uniformly as an array. If it's not already an array,
// store it as the only entry in one. (But let's say Undefined means an
@@ -917,9 +918,9 @@ LLSD& drill(LLSD& blob, const LLSD& rawPath)
LLSD drill(const LLSD& blob, const LLSD& path)
{
- // non-const drill() does exactly what we want. Temporarily cast away
+ // drill_ref() does exactly what we want. Temporarily cast away
// const-ness and use that.
- return drill(const_cast<LLSD&>(blob), path);
+ return drill_ref(const_cast<LLSD&>(blob), path);
}
} // namespace llsd
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index 8678ca97f2..1321615805 100644
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -184,10 +184,10 @@ namespace llsd
* - Anything else is an error.
*
* By implication, if path.isUndefined() or otherwise equivalent to an empty
- * LLSD::Array, drill() returns 'blob' as is.
+ * LLSD::Array, drill[_ref]() returns 'blob' as is.
*/
LLSD drill(const LLSD& blob, const LLSD& path);
-LLSD& drill( LLSD& blob, const LLSD& path);
+LLSD& drill_ref( LLSD& blob, const LLSD& path);
}
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index ba5fcc3421..3d33267267 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -195,18 +195,6 @@ LLOSInfo::LLOSInfo() :
GetSystemInfo(&si); //if it fails get regular system info
//(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load)
- //msdn microsoft finds 32 bit and 64 bit flavors this way..
- //http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx (example code that contains quite a few more flavors
- //of windows than this code does (in case it is needed for the future)
- if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) //check for 64 bit
- {
- mOSStringSimple += "64-bit ";
- }
- else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
- {
- mOSStringSimple += "32-bit ";
- }
-
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
@@ -253,9 +241,21 @@ LLOSInfo::LLOSInfo() :
// Query WMI's Win32_OperatingSystem for OS string. Slow
// and likely to return 'compatibility' string.
// Check presence of dlls/libs or may be their version.
- mOSStringSimple = "Microsoft Windows 10/11";
+ mOSStringSimple = "Microsoft Windows 10/11 ";
}
- }
+ }
+
+ //msdn microsoft finds 32 bit and 64 bit flavors this way..
+ //http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx (example code that contains quite a few more flavors
+ //of windows than this code does (in case it is needed for the future)
+ if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) //check for 64 bit
+ {
+ mOSStringSimple += "64-bit ";
+ }
+ else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ {
+ mOSStringSimple += "32-bit ";
+ }
mOSString = mOSStringSimple;
if (mBuild > 0)