MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ExplicitProducer

Method ExplicitProducer

deps/concurrentqueue/concurrentqueue.h:1751–1766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1749 struct ExplicitProducer : public ProducerBase
1750 {
1751 explicit ExplicitProducer(ConcurrentQueue* parent_) :
1752 ProducerBase(parent_, true),
1753 blockIndex(nullptr),
1754 pr_blockIndexSlotsUsed(0),
1755 pr_blockIndexSize(EXPLICIT_INITIAL_INDEX_SIZE >> 1),
1756 pr_blockIndexFront(0),
1757 pr_blockIndexEntries(nullptr),
1758 pr_blockIndexRaw(nullptr)
1759 {
1760 size_t poolBasedIndexSize = details::ceil_to_pow_2(parent_->initialBlockPoolSize) >> 1;
1761 if (poolBasedIndexSize > pr_blockIndexSize) {
1762 pr_blockIndexSize = poolBasedIndexSize;
1763 }
1764
1765 new_block_index(0); // This creates an index with double the number of current entries, i.e. EXPLICIT_INITIAL_INDEX_SIZE
1766 }
1767
1768 ~ExplicitProducer()
1769 {

Callers

nothing calls this directly

Calls 2

ceil_to_pow_2Function · 0.85
new_block_indexFunction · 0.85

Tested by

no test coverage detected