| 510 | } |
| 511 | |
| 512 | void |
| 513 | FabArrayBase::flushCPC (bool no_assertion) const |
| 514 | { |
| 515 | amrex::ignore_unused(no_assertion); |
| 516 | BL_ASSERT(no_assertion || getBDKey() == m_bdkey); |
| 517 | |
| 518 | std::vector<CPCacheIter> others; |
| 519 | |
| 520 | std::pair<CPCacheIter,CPCacheIter> er_it = m_TheCPCache.equal_range(m_bdkey); |
| 521 | |
| 522 | for (auto it = er_it.first; it != er_it.second; ++it) |
| 523 | { |
| 524 | const BDKey& srckey = it->second->m_srcbdk; |
| 525 | const BDKey& dstkey = it->second->m_dstbdk; |
| 526 | |
| 527 | BL_ASSERT((srckey==dstkey && srckey==m_bdkey) || |
| 528 | (m_bdkey==srckey) || (m_bdkey==dstkey)); |
| 529 | |
| 530 | if (srckey != dstkey) { |
| 531 | const BDKey& otherkey = (m_bdkey == srckey) ? dstkey : srckey; |
| 532 | std::pair<CPCacheIter,CPCacheIter> o_er_it = m_TheCPCache.equal_range(otherkey); |
| 533 | for (auto oit = o_er_it.first; oit != o_er_it.second; ++oit) |
| 534 | { |
| 535 | if (it->second == oit->second) { |
| 536 | others.push_back(oit); |
| 537 | } |
| 538 | } |
| 539 | } |
| 540 | |
| 541 | #ifdef AMREX_MEM_PROFILING |
| 542 | m_CPC_stats.bytes -= it->second->bytes(); |
| 543 | #endif |
| 544 | m_CPC_stats.recordErase(it->second->m_nuse); |
| 545 | delete it->second; |
| 546 | } |
| 547 | |
| 548 | m_TheCPCache.erase(er_it.first, er_it.second); |
| 549 | |
| 550 | for (auto const& it : others) { |
| 551 | m_TheCPCache.erase(it); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | void |
| 556 | FabArrayBase::flushCPCache () |
nothing calls this directly
no test coverage detected