MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / size

Method size

3rd/MPMCQueue/include/MPMCQueue.hpp:132–136  ·  view source on GitHub ↗

* @brief Get an approximate size of the queue * * Note: This is an approximation and may not be accurate in concurrent * scenarios. * * @return size_t Approximate number of elements in the queue */

Source from the content-addressed store, hash-verified

130 * @return size_t Approximate number of elements in the queue
131 */
132 [[nodiscard]] auto size() const noexcept -> size_t {
133 size_t head = head_.load(std::memory_order_relaxed);
134 size_t tail = tail_.load(std::memory_order_relaxed);
135 return head >= tail ? head - tail : 0;
136 }
137
138 /**
139 * @brief Check if the queue is empty (approximate)

Callers 15

GetQueueSizeMethod · 0.80
GetQueueSizeMethod · 0.80
EnqueueMethod · 0.80
GetQueueSizeMethod · 0.80
ProbeMethod · 0.80
GetNameMethod · 0.80
RegisterMethod · 0.80
MountMethod · 0.80
LookupMethod · 0.80
CreateMethod · 0.80
UnlinkMethod · 0.80
GetElfSizeMethod · 0.80

Calls

no outgoing calls

Tested by 8

TESTFunction · 0.64
TEST_FFunction · 0.64
GetAllocatedCountMethod · 0.64
GetCoreMethod · 0.64
GetCoreCountMethod · 0.64
BindThreadToCoreMethod · 0.64
GetCoreIdForThreadMethod · 0.64
DumpAllCoreStatesMethod · 0.64