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

Sub buffers #5

Open
dktapps opened this issue Feb 17, 2023 · 1 comment
Open

Sub buffers #5

dktapps opened this issue Feb 17, 2023 · 1 comment

Comments

@dktapps
Copy link
Member

dktapps commented Feb 17, 2023

A ByteBuffer which can read from a subsection of another ByteBuffer's memory would be useful for reducing allocations.

For example, Minecraft packet batches contain length-prefixed packet buffers. Each of these buffers currently has to be copied to a new BinaryStream via substr() in order to be decoded. This allocation could be avoided if BinaryStream were capable of directly reading the memory of the original stream.

@dktapps
Copy link
Member Author

dktapps commented Oct 27, 2023

This will require removing the zend_string* currently used to handle buffers internally, as zend_string can't be made to point at existing data. never mind... this is solvable in other ways

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