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

Method size_approx

deps/concurrentqueue/concurrentqueue.h:1304–1311  ·  view source on GitHub ↗

Returns an estimate of the total number of elements currently in the queue. This estimate is only accurate if the queue has completely stabilized before it is called (i.e. all enqueue and dequeue operations have completed and their memory effects are visible on the calling thread, and no further operations start while this method is being called). Thread-safe.

Source from the content-addressed store, hash-verified

1302 // being called).
1303 // Thread-safe.
1304 size_t size_approx() const
1305 {
1306 size_t size = 0;
1307 for (auto ptr = producerListTail.load(std::memory_order_acquire); ptr != nullptr; ptr = ptr->next_prod()) {
1308 size += ptr->size_approx();
1309 }
1310 return size;
1311 }
1312
1313
1314 // Returns true if the underlying atomic variables used by

Callers

nothing calls this directly

Calls 2

next_prodMethod · 0.80
size_approxMethod · 0.45

Tested by

no test coverage detected