[catnap] Allow chained DemiBuffers buffers for push and pop #1140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
chain
orappend
method onDemiBuffer
. 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.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 :)