MCPcopy Create free account
hub / github.com/beefytech/Beef / Close

Method Close

IDEHelper/Compiler/BfParser.cpp:3878–3903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3876}
3877
3878void BfParser::Close()
3879{
3880 BfSource::Close();
3881
3882 BfLogSys(mSystem, "Parser %p closing. RefCount:%d Failed:%d\n", this, mParserData->mRefCount, mParserData->mFailed);
3883
3884 if ((mParserData->mRefCount == 0) && (!mParserData->mFailed))
3885 {
3886 BF_ASSERT(mParserData->mDidReduce);
3887
3888 AutoCrit autoCrit(gBfParserCache->mCritSect);
3889 BfParserCache::DataEntry dataEntry;
3890 dataEntry.mParserData = mParserData;
3891 if (gBfParserCache->mEntries.Add(dataEntry))
3892 {
3893 BfLogSys(mSystem, "Parser %p added to cache\n", this);
3894 mParserData->mRefCount++;
3895 }
3896 else
3897 {
3898 // It's possible two of the same entries were being parsed at the same time on different threads.
3899 // Just let the loser be deleted in the dtor
3900 BfLogSys(mSystem, "Duplicate parser %p not added to cache\n", this);
3901 }
3902 }
3903}
3904
3905void BfParser::HadSrcRealloc()
3906{

Callers 2

BfParser_ReduceFunction · 0.45
BfParser_ClassifySourceFunction · 0.45

Calls 2

CloseFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected