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

Method Clear

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:5567–5606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5565}
5566
5567void BfHotMethod::Clear(bool keepDupMethods)
5568{
5569 if (mPrevVersion != NULL)
5570 {
5571 mPrevVersion->Deref();
5572 mPrevVersion = NULL;
5573 }
5574
5575 if (mSrcTypeVersion != NULL)
5576 {
5577 mSrcTypeVersion->Deref();
5578 mSrcTypeVersion = NULL;
5579 }
5580
5581 if ((keepDupMethods) && ((mFlags & BfHotDepDataFlag_HasDup) != 0))
5582 {
5583 int writeIdx = 0;
5584 for (int i = 0; i < (int)mReferences.size(); i++)
5585 {
5586 auto depData = mReferences[i];
5587 if (depData->mDataKind == BfHotDepDataKind_DupMethod)
5588 {
5589 mReferences[writeIdx++] = depData;
5590 }
5591 else
5592 {
5593 depData->Deref();
5594 }
5595 }
5596 mReferences.mSize = writeIdx;
5597 }
5598 else
5599 {
5600 for (auto depData : mReferences)
5601 {
5602 depData->Deref();
5603 }
5604 mReferences.Clear();
5605 }
5606}
5607
5608BfHotMethod::~BfHotMethod()
5609{

Callers 9

UndoDeclarationMethod · 0.45
~BfTypeInstanceMethod · 0.45
ReleaseDataMethod · 0.45
~BfClosureTypeMethod · 0.45
~BfDelegateTypeMethod · 0.45
~BfTupleTypeMethod · 0.45
InitMethod · 0.45
~BfTagTypeMethod · 0.45

Calls 2

DerefMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected