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:
@@ -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)
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
TLSBlock CreateBlock(unsigned dso);
|
||||
|
||||
private:
|
||||
TLSBlockTemplates() { }
|
||||
inline TLSBlockTemplates();
|
||||
|
||||
static TLSBlockTemplates* fInstance;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user