MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / MOODYCAMEL_CATCH

Function MOODYCAMEL_CATCH

include/dmlc/concurrentqueue.h:2715–2751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2713 }
2714 }
2715 MOODYCAMEL_CATCH (...) {
2716 auto constructedStopIndex = currentTailIndex;
2717 auto lastBlockEnqueued = this->tailBlock;
2718
2719 if (!details::is_trivially_destructible<T>::value) {
2720 auto block = startBlock;
2721 if ((startTailIndex & static_cast<index_t>(BLOCK_SIZE - 1)) == 0) {
2722 block = firstAllocatedBlock;
2723 }
2724 currentTailIndex = startTailIndex;
2725 while (true) {
2726 stopIndex = (currentTailIndex & ~static_cast<index_t>(BLOCK_SIZE - 1)) +
2727 static_cast<index_t>(BLOCK_SIZE);
2728 if (details::circular_less_than<index_t>(constructedStopIndex, stopIndex)) {
2729 stopIndex = constructedStopIndex;
2730 }
2731 while (currentTailIndex != stopIndex) {
2732 (*block)[currentTailIndex++]->~T();
2733 }
2734 if (block == lastBlockEnqueued) {
2735 break;
2736 }
2737 block = block->next;
2738 }
2739 }
2740
2741 currentTailIndex = (startTailIndex - 1) & ~static_cast<index_t>(BLOCK_SIZE - 1);
2742 for (auto block = firstAllocatedBlock; block != nullptr; block = block->next) {
2743 currentTailIndex += static_cast<index_t>(BLOCK_SIZE);
2744 auto idxEntry = get_block_index_entry_for_index(currentTailIndex);
2745 idxEntry->value.store(nullptr, std::memory_order_relaxed);
2746 rewind_block_index_tail();
2747 }
2748 this->parent->add_blocks_to_free_list(firstAllocatedBlock);
2749 this->tailBlock = startBlock;
2750 MOODYCAMEL_RETHROW;
2751 }
2752 }
2753
2754 if (this->tailBlock == endBlock) {

Callers

nothing calls this directly

Calls 2

rewind_block_index_tailFunction · 0.85

Tested by

no test coverage detected