summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-05-14 14:07:36 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-05-14 14:07:36 +0300
commit83dcf6b10daff1ec886063a968c884cdc79c47ed (patch)
tree467a136308ae8218a12116a35c0eddb4468431a8 /indra
parentf77de22d4de7c5d036f2258134c43c495fe43e50 (diff)
MAINT-8689 Diagnostics for coroutine memory crash
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llcoros.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp
index 4bab669046..3165ce0743 100644
--- a/indra/llcommon/llcoros.cpp
+++ b/indra/llcommon/llcoros.cpp
@@ -283,6 +283,7 @@ void LLCoros::setStackSize(S32 stacksize)
void LLCoros::printActiveCoroutines()
{
+ LL_INFOS("LLCoros") << "Number of active coroutines: " << (S32)mCoros.size() << LL_ENDL;
LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------";
CoroMap::iterator iter;
CoroMap::iterator end = mCoros.end();
@@ -401,7 +402,13 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl
std::string name(generateDistinctName(prefix));
Current current;
// pass the current value of Current as previous context
- CoroData* newCoro = new CoroData(current, name, callable, mStackSize);
+ CoroData* newCoro = new(std::nothrow) CoroData(current, name, callable, mStackSize);
+ if (newCoro == NULL)
+ {
+ // Out of memory?
+ printActiveCoroutines();
+ LL_ERRS("LLCoros") << "Failed to start coroutine: " << name << " Stacksize: " << mStackSize << " Total coroutines: " << mCoros.size() << LL_ENDL;
+ }
// Store it in our pointer map
mCoros.insert(name, newCoro);
// also set it as current