MCPcopy Create free account
hub / github.com/KDE/kdevelop / newTopContextIndex

Method newTopContextIndex

kdevplatform/language/duchain/duchain.cpp:1768–1785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1766}
1767
1768uint DUChain::newTopContextIndex()
1769{
1770 {
1771 QMutexLocker lock(&sdDUChainPrivate->m_chainsMutex);
1772 if (!sdDUChainPrivate->m_availableTopContextIndices.isEmpty()) {
1773 uint ret = sdDUChainPrivate->m_availableTopContextIndices.back();
1774 sdDUChainPrivate->m_availableTopContextIndices.pop_back();
1775 if (TopDUContextDynamicData::fileExists(ret)) {
1776 qCWarning(LANGUAGE) << "Problem in the management of available top-context indices";
1777 return newTopContextIndex();
1778 }
1779 return ret;
1780 }
1781 }
1782 static QAtomicInt& currentId(globalItemRepositoryRegistry().customCounter(QStringLiteral("Top-Context Counter"),
1783 1));
1784 return currentId.fetchAndAddRelaxed(1);
1785}
1786
1787void DUChain::refCountUp(TopDUContext* top)
1788{

Callers 1

testImportCacheMethod · 0.80

Calls 2

isEmptyMethod · 0.45
backMethod · 0.45

Tested by 1

testImportCacheMethod · 0.64