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.push_back(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
fTemplates[dso].SetGeneration(fGeneration++);
|
fTemplates[dso].SetGeneration(fGeneration);
|
||||||
return dso;
|
return dso;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,6 +127,7 @@ TLSBlockTemplates::Unregister(unsigned dso)
|
|||||||
if (dso == unsigned(-1))
|
if (dso == unsigned(-1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
fGeneration++;
|
||||||
fFreeDSOs.push_back(dso);
|
fFreeDSOs.push_back(dso);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +156,13 @@ TLSBlockTemplates::CreateBlock(unsigned dso)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TLSBlockTemplates::TLSBlockTemplates()
|
||||||
|
:
|
||||||
|
fGeneration(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TLSBlock::TLSBlock()
|
TLSBlock::TLSBlock()
|
||||||
:
|
:
|
||||||
fPointer(NULL)
|
fPointer(NULL)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
TLSBlock CreateBlock(unsigned dso);
|
TLSBlock CreateBlock(unsigned dso);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TLSBlockTemplates() { }
|
inline TLSBlockTemplates();
|
||||||
|
|
||||||
static TLSBlockTemplates* fInstance;
|
static TLSBlockTemplates* fInstance;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user