Skip to content

buf.slice() should do parent tracking to match node api behavior #9

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

Closed
feross opened this issue Dec 28, 2013 · 0 comments
Closed

buf.slice() should do parent tracking to match node api behavior #9

feross opened this issue Dec 28, 2013 · 0 comments
Labels

Comments

@feross
Copy link
Owner

feross commented Dec 28, 2013

See for description of the problem: toots/buffer-browserify#19

From the node docs:

buf.slice([start], [end])#
start Number, Optional, Default: 0
end Number, Optional, Default: buffer.length
Returns a new buffer which references the same memory as the old, but offset and cropped by the start (defaults to 0) and end (defaults to buffer.length) indexes. Negative indexes start from the end of the buffer.

Modifying the new buffer slice will modify memory in the original buffer!
@feross feross closed this as completed in 500be9e Jan 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant