Skip to content

Backup a buffer #69

Answered by rlogiacco
maxholgasson asked this question in Q&A
Discussion options

You must be logged in to vote

The buffer is a storage area and you are not forced to eliminate an entry when retrieving it... the whole concept of the circular buffer is to use a fixed amount of memory to store and retrieve data... now you ask how to duplicate an entire buffer? I fail to see the picture, you are probably looking for a different data structure.
If you really want to do that, just create a second buffer of the same type and capacity, iterate over the "live" buffer and push into the "clone" buffer.... Double the memory use

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rlogiacco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants