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

Method ProcessAtomGraveyard

IDEHelper/Compiler/BfSystem.cpp:2266–2287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2264}
2265
2266void BfSystem::ProcessAtomGraveyard()
2267{
2268 // We need this set, as it's possible to have multiple of the same entry in the graveyard
2269 // if we ref and then deref again
2270 HashSet<BfAtom*> deletedAtoms;
2271
2272 for (auto atom : mAtomGraveyard)
2273 {
2274 if (deletedAtoms.Contains(atom))
2275 continue;
2276
2277 BF_ASSERT(atom->mRefCount >= 0);
2278 if (atom->mRefCount == 0)
2279 {
2280 deletedAtoms.Add(atom);
2281 auto itr = mAtomMap.Remove(atom->mString);
2282 free((void*)atom->mString.mPtr);
2283 delete atom;
2284 }
2285 }
2286 mAtomGraveyard.Clear();
2287}
2288
2289bool BfSystem::ParseAtomComposite(const StringView& name, BfAtomComposite& composite, bool addRefs)
2290{

Callers 1

DoCompileMethod · 0.80

Calls 5

freeFunction · 0.50
ContainsMethod · 0.45
AddMethod · 0.45
RemoveMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected