runtime_loader: fix CID 1211995, improve generation counting

There is no need to increase generation counter each time new DSO is
registered.
This commit is contained in:
Pawel Dziepak
2014-05-08 23:07:50 +02:00
parent fad7246fcd
commit 680ca3b13d
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -116,7 +116,7 @@ TLSBlockTemplates::Register(const TLSBlockTemplate& block)
fTemplates.push_back(block);
}
fTemplates[dso].SetGeneration(fGeneration++);
fTemplates[dso].SetGeneration(fGeneration);
return dso;
}
@@ -127,6 +127,7 @@ TLSBlockTemplates::Unregister(unsigned dso)
if (dso == unsigned(-1))
return;
fGeneration++;
fFreeDSOs.push_back(dso);
}
@@ -155,6 +156,13 @@ TLSBlockTemplates::CreateBlock(unsigned dso)
}
TLSBlockTemplates::TLSBlockTemplates()
:
fGeneration(0)
{
}
TLSBlock::TLSBlock()
:
fPointer(NULL)
+1 -1
View File
@@ -48,7 +48,7 @@ public:
TLSBlock CreateBlock(unsigned dso);
private:
TLSBlockTemplates() { }
inline TLSBlockTemplates();
static TLSBlockTemplates* fInstance;