MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / get_node_at

Method get_node_at

benchmarks/simplelockfree.h:249–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247
248
249 inline Node* get_node_at(idx_t idx)
250 {
251 auto uberBlock = uberBlockContainer.subblocks[(idx & UBER_BLOCK_IDX_MASK) >> UBER_BLOCK_IDX_SHIFT].load(std::memory_order_relaxed);
252 auto ultraBlock = uberBlock->subblocks[(idx & UBER_BLOCK_MASK) >> UBER_BLOCK_SHIFT].load(std::memory_order_relaxed);
253 auto superBlock = ultraBlock->subblocks[(idx & ULTRA_BLOCK_MASK) >> ULTRA_BLOCK_SHIFT].load(std::memory_order_relaxed);
254 auto block = superBlock->subblocks[(idx & SUPER_BLOCK_MASK) >> SUPER_BLOCK_SHIFT].load(std::memory_order_relaxed);
255 return reinterpret_cast<Node*>(block->node_pos(idx));
256 }
257
258 template<typename U>
259 inline idx_t allocate_node_for(U&& item)

Callers

nothing calls this directly

Calls 2

node_posMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected