MCPcopy Create free account
hub / github.com/FastLED/FastLED / tryPop

Method tryPop

src/fl/log/async_log_queue.cpp.hpp:51–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template <fl::size DescriptorCount, fl::size ArenaSize>
51bool AsyncLogQueue<DescriptorCount, ArenaSize>::tryPop(const char** outPtr, fl::u16* outLen) {
52 // Read head with memory barrier (acquire semantics)
53 fl::u32 head = loadHead();
54 fl::u32 tail = mTail;
55
56 if (tail == head) {
57 return false; // Queue empty
58 }
59
60 // Read descriptor at tail position
61 const Descriptor& desc = mDescriptors[tail];
62
63 // Return pointer into arena (contiguous due to padding at wrap)
64 *outPtr = &mArena[desc.mStartIdx];
65 *outLen = desc.mLength;
66
67 return true;
68}
69
70template <fl::size DescriptorCount, fl::size ArenaSize>
71void AsyncLogQueue<DescriptorCount, ArenaSize>::commit() {

Callers 4

flushMethod · 0.80
clearMethod · 0.80
flushNMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected