Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deque.h - Extract away initialization logic of Deque.buff #1

Open
albertoCCz opened this issue Oct 22, 2023 · 0 comments
Open

Deque.h - Extract away initialization logic of Deque.buff #1

albertoCCz opened this issue Oct 22, 2023 · 0 comments

Comments

@albertoCCz
Copy link
Owner

Initialization of Deque.buff is done in many places and might be convenient to move it to it's own function.

In principle, and without having examine it in detail, I think it might be enough to pass the start and end indexes of the buff to initialize as this chunk of memory should be always contiguous. Also, take care of empty_back and empty_head of Deque struct.

Possible prototype:
void __deque_initialize(Deque *deque, size_t start, size_t end)

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

No branches or pull requests

1 participant