summaryrefslogtreecommitdiff
path: root/indra/llcommon/llcoros.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2013-05-23 16:28:20 -0400
committerNat Goodspeed <nat@lindenlab.com>2013-05-23 16:28:20 -0400
commit3be79d5371c291264b12ecb3bf8daf0761bf1123 (patch)
tree49ff523969559f399e5f6912c7aa9afe4149d033 /indra/llcommon/llcoros.cpp
parent7fad053982d835ff5b9ec496bc94ddbedc234dcc (diff)
MAINT-2724: Make viewer explicitly set coroutine stack size.
Introduce LLCoros::setStackSize(), with a compile-time default value we hope we never have to use. Make LLAppViewer call it with the value of the new settings variable CoroutineStackSize as soon as we've read settings files. (While we're at it, notify interested parties that we've read settings files.) Give CoroutineStackSize a default value four times the previous default stack size. Make LLCoros::launch() pass the saved stack size to each new coroutine instance. Re-enable lleventcoro integration test. Use LLSDMap() construct rather than LLSD::insert(), which used to return the modified object but is now void.
Diffstat (limited to 'indra/llcommon/llcoros.cpp')
-rwxr-xr-xindra/llcommon/llcoros.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 9122704306..a629f71d4b 100755
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -39,7 +39,12 @@
#include "llerror.h"
#include "stringize.h"
-LLCoros::LLCoros()
+LLCoros::LLCoros():
+ // MAINT-2724: default coroutine stack size too small on Windows.
+ // Previously we used
+ // boost::context::guarded_stack_allocator::default_stacksize();
+ // empirically this is 64KB on Windows and Linux. Try quadrupling.
+ mStackSize(256*1024)
{
// Register our cleanup() method for "mainloop" ticks
LLEventPumps::instance().obtain("mainloop").listen(
@@ -125,6 +130,12 @@ std::string LLCoros::getNameByID(const void* self_id) const
return "";
}
+void LLCoros::setStackSize(S32 stacksize)
+{
+ LL_INFOS("LLCoros") << "Setting coroutine stack size to " << stacksize << LL_ENDL;
+ mStackSize = stacksize;
+}
+
/*****************************************************************************
* MUST BE LAST
*****************************************************************************/