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

[catnap] Allow chained DemiBuffers buffers for push and pop #1140

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

kyleholohan
Copy link
Contributor

@kyleholohan kyleholohan commented Jan 22, 2024

This is a draft to discuss approach.

Add a next method to DemiBuffer which will instantiate a new DemiBuffer for the next chained buffer (if any such buffer is present). Allow chained buffers in Windows catnap push/pop operations.

There are some issues with the approach as stated:

  • There is no way to chain buffers currently.
  • Assume we have some chain or append method on DemiBuffer. This method must consume the buffer being chained to be consistent with other support functions. Specifically, clone, which will fork the MetaData for a buffer to avoid having more than one mutable view of a DemiBuffer.
  • The mutable/reference semantics are not correct. Currently, a user may call next more than once on the same DemiBuffer. Since DemiBuffer is a reference to MetaData, this allows mutliple mutable references.

I'm going to reverse my position: DemiBuffer should wrap the entire buffer chain, rather than an individual chunk. This would make solving reference issues much simpler.

Also, I didn't do any testing yet :)

@ppenna ppenna self-assigned this Jan 23, 2024
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.

None yet

2 participants