Skip to content

fix panic if copying in exactly the buffer size#50

Merged
gammazero merged 1 commit intomainfrom
fix-copy-in-slize-panic
Feb 11, 2026
Merged

fix panic if copying in exactly the buffer size#50
gammazero merged 1 commit intomainfrom
fix-copy-in-slize-panic

Conversation

@gammazero
Copy link
Owner

If Copy or CopyInSlice copied exactly the buffer size nubber of elements, and then an item was removed from the back of the deque, this caused a panic. This was due to the tail not being wrapped around to the front of the buffer if the data copied in aligned with the buffer boundary. This is fixed by properly wrapping the tail index to the start of the buffer.

Closes #47

If Copy or CopyInSlice copied exactly the buffer size nubber of elements, and then an item was removed from the back of the deque, this caused a panic. This was due to the tail not being wrapped around to the front of the buffer if the data copied in aligned with the buffer boundary. This is fixed by properly wrapping the tail index to the start of the buffer.

Closes #47
@gammazero gammazero merged commit 368a2c8 into main Feb 11, 2026
2 checks passed
@gammazero gammazero deleted the fix-copy-in-slize-panic branch February 11, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic when CopyInSlice + PopFront

1 participant