Avoid bogging down main thread with excessive LLInstanceTrackerBase::getInstances calls.
This commit is contained in:
@@ -54,7 +54,10 @@ protected:
|
|||||||
template<typename STATICDATA, class TRACKED>
|
template<typename STATICDATA, class TRACKED>
|
||||||
static STATICDATA& getStatic()
|
static STATICDATA& getStatic()
|
||||||
{
|
{
|
||||||
void *& instances = getInstances(typeid(TRACKED));
|
//Singu note: Don't de-static the instances variable. getInstances is incredibly
|
||||||
|
//expensive. Calling getInstances once and caching the result is sufficient
|
||||||
|
//to avoid the instance-per-module issue noted above.
|
||||||
|
static void *& instances = getInstances(typeid(TRACKED));
|
||||||
if (! instances)
|
if (! instances)
|
||||||
{
|
{
|
||||||
instances = new STATICDATA;
|
instances = new STATICDATA;
|
||||||
|
|||||||
Reference in New Issue
Block a user