Questions tagged [circular-list]
A circular list may be implemented using a fixed-size array (a ring buffer) or a linked list.
153 questions
4
votes
1
answer
145
views
Compute index in a ring buffer
I have a buffer implemented as a fixed-size std::vector with two begin and end pointers ...
4
votes
2
answers
147
views
Generic ring-buffer
What would be the preferred C way of implementing a simple generic ring-buffer.
Which approach from the 2 below (or even some 3rd) would you use and why?
Specifically, this will be part of an embedded ...
4
votes
1
answer
86
views
Ringbuffer over a const generic Array in Rust
I implemented this generic ringbuffer over a const generic array with the usage of the MaybeUninit type.
Is there something which is maybe unsound (having the lines ...
3
votes
2
answers
106
views
Enhancing a non-multithreaded Circular buffer
Looking to get some feedback on a simple non-multithreaded circular buffer.
Ideally, I'd want to have a logic to prevent the data from getting overwritten but couldn't find a reasonable way.
For ...
1
vote
2
answers
135
views
Circular list vs. doubly-linked list: which is faster?
In this post, I will compare performance of a circular list and a conventional list with head/tail -references:
...
6
votes
2
answers
1k
views
A not so simple C++20 circular queue
This container reduces the number of memory allocations on queue-type operations (push + pop) compared to std::deque. Basic performance tests indicates a performance similar to std::deque where main ...
2
votes
1
answer
271
views
Simple C++ circular queue
I wrote a simple C++20 circular queue.
https://github.com/torrentg/cqueue
Here is cqueue.hpp
...
2
votes
1
answer
152
views
Ring buffer for non-trivial types
I tried to explain in detail everything there should be of concern regarding this particular implementation, and non-code body turned out quite long, scroll down if you just want to read the ...
6
votes
2
answers
1k
views
std::array based push-only circular buffer
Minimal implementation of a circular buffer based on std::array, where elements can only be pushed and iterated. I'm interested on potential failures and very trivial optimizations, as I'd like to ...
6
votes
4
answers
1k
views
Naming a method that gets the next enum value or starts from the beginning if the given value is the last
I'm struggling to find a proper name for a specific method (in code named NameOfExtension), and would also like some feedback about its implementation.
I am ...
2
votes
1
answer
1k
views
C++ circular buffer that guarantees contiguous data
For interfacing with C-API that requires data in one contiguous block
I came up with the following, which seems to work nicely, but I wanted
to see if I didn't miss anything crucial. Drawback is of ...
1
vote
1
answer
242
views
next/prev function for a circular array
This is a next/prev function for use in a circular array. What do you think?
...
3
votes
4
answers
1k
views
Ring buffer for Arduino
Just wrote this small ring buffer system for an embedded device using C++98. Looking for cc, advice and bugs.
Please check it out!
https://github.com/Bambofy/EmbeddedRingBuffer
...
1
vote
3
answers
142
views
Embedded IoT: local data storage (Second Update)
I have made the review changes based on feedback I have got from here which was based on the feedback I got from this one. I am almost done and now looking for a final review with respect to any minor ...
4
votes
3
answers
111
views
Embedded IoT: local data storage (Updated)
I have made most of the review changes based on feedback I have got from here. Now I am back here for a second review to further better my code. Before posting the changes, somethings I haven't ...