GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — Buffer Use Uint8Array by trevnorris · Pull Request #1825 · nodejs/node Conversation
Contributor
This is still partially incomplete. All tests are passing, but some parts still need to be hardened. The native API needs to return All existing tests are passing. A good chunk of the JS changes are whitespace related. For the conditional logic to allow
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsAllowing the name to be passed to the ARGS_THIS macro will make it easier to share code with the Uint8Array implementation.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we can't resize these Buffers as we could previously, the complete string write is done on the native side so the memory can be shrunk for base64 encoding before it is passed to the new buffer.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might not need any of the custom iterator implementation for the new version (i.e. can hide all this behind an if)
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Already do, and you're right. It doesn't. :)
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, just scrolled past that part, sorry!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: instead of having
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooh. I like that.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this before I realized that just because ArrayBuffers can be arbitrarily big, typed arrays can't. So it was "technically" possible to set the pool size greater than a bitwise operation could handle. But that's not actually the case. So I'll change that back.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
trevnorris
added a commit
that referenced
this pull request
With V8 4.4 removing the external array data API currently used by Buffer, the new implementation uses the Uint8Array to back Buffer. Buffers now have a maximum size of Smi::kMaxLength, as defined by V8. Which is ~2 GB on 64 bit and ~1 GB on 32 bit. The flag --use-old-buffer allows using the old Buffer implementation. This flag will be removed once V8 4.4 has landed. The two JS Buffer implementations have been split into two files for simplicity. Use getter to return expected .parent/.offset values for backwards compatibility. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Passing a FreeCallback to Buffer::New() now uses externalized ArrayBuffer's. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Use the new Maybe<T> syntax for v8::Object::SetPrototype(). PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Instead of aborting in case of internal failure, return an empty Local<Object>. Using the MaybeLocal<T> API, users must check their return values. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Address comments and deprecations left in source files. These changes include: * Remove the deprecated API. * Change Buffer::New() that did a copy of the data to Buffer::Copy() * Change Buffer::Use() to Buffer::New() PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
New Buffer implementation allows greater than kMaxLength to be created. So instead check if the passed value is a valid Smi. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Allowing the name to be passed to the ARGS_THIS macro will make it easier to share code with the Uint8Array implementation. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
With V8 4.4 removing the external array data API currently used by Buffer, the new implementation uses the Uint8Array to back Buffer. Buffers now have a maximum size of Smi::kMaxLength, as defined by V8. Which is ~2 GB on 64 bit and ~1 GB on 32 bit. The flag --use-old-buffer allows using the old Buffer implementation. This flag will be removed once V8 4.4 has landed. The two JS Buffer implementations have been split into two files for simplicity. Use getter to return expected .parent/.offset values for backwards compatibility. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Passing a FreeCallback to Buffer::New() now uses externalized ArrayBuffer's. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Use the new Maybe<T> syntax for v8::Object::SetPrototype(). PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Instead of aborting in case of internal failure, return an empty Local<Object>. Using the MaybeLocal<T> API, users must check their return values. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Address comments and deprecations left in source files. These changes include: * Remove the deprecated API. * Change Buffer::New() that did a copy of the data to Buffer::Copy() * Change Buffer::Use() to Buffer::New() PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
New Buffer implementation allows greater than kMaxLength to be created. So instead check if the passed value is a valid Smi. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
Allowing the name to be passed to the ARGS_THIS macro will make it easier to share code with the Uint8Array implementation. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
trevnorris
added a commit
that referenced
this pull request
With V8 4.4 removing the external array data API currently used by Buffer, the new implementation uses the Uint8Array to back Buffer. Buffers now have a maximum size of Smi::kMaxLength, as defined by V8. Which is ~2 GB on 64 bit and ~1 GB on 32 bit. The flag --use-old-buffer allows using the old Buffer implementation. This flag will be removed once V8 4.4 has landed. The two JS Buffer implementations have been split into two files for simplicity. Use getter to return expected .parent/.offset values for backwards compatibility. PR-URL: #1825 Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
buffer
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |