MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / FixedQueue

Method FixedQueue

app/src/DSP.h:78–85  ·  view source on GitHub ↗

* @brief Constructs a FixedQueue with a given logical capacity. Backing storage * is rounded up to the next power of two for fast wrap-around. */

Source from the content-addressed store, hash-verified

76 * is rounded up to the next power of two for fast wrap-around.
77 */
78 explicit FixedQueue(std::size_t capacity = 100)
79 : m_capacity(capacity < 1 ? 1 : capacity)
80 , m_storageCapacity(roundUpToPowerOfTwo(capacity < 1 ? 1 : capacity))
81 , m_storageMask(m_storageCapacity - 1)
82 , m_data(makeStorage(m_storageCapacity))
83 , m_start(0)
84 , m_size(0)
85 {}
86
87 /**
88 * @brief Copy constructor.

Callers

nothing calls this directly

Calls 1

roundUpToPowerOfTwoFunction · 0.70

Tested by

no test coverage detected