-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Buffer implemented using Uint8Array #1810
Comments
If 2: If there will be breaking changes to the API, it should not be hidden behind flags. Better be preemptive and avoid additional woes for the next update. 4: Probably because of https://github.com/nodejs/io.js/blob/next/src/node.cc#L168 and https://github.com/nodejs/io.js/blob/next/src/node.cc#L177 |
@kkoopa Using I have greater concern for security than for API compatibility. Buffer underpins almost everything, and so I believe we should be cautious about a new implementation. The point of the flag is to allow a release cycle of the new implementation being publicly available for testing, bug filing, etc. before it's rolled out as standard. Great find on (4). Since |
I understand why you may want to keep it behind a flag, but keep in mind that nobody uses flags or release candidates. Having it there behind a flag is almost like not having it at all. Who would Any new major release is expected to have bugs which will be fixed in subsequent patches. As I understand it, the JS API will be largely unaffected by the change and those using the C++ API will have a lot of rewriting to do anyway, because of the changes in V8. NAN does not detect runtime flags, and so could not know which one is in use and would default to the non-flagged version. This will result in the new API not getting used or tested before io.js 4.0, when they will have to update their code again, having just fixed a bunch of stuff for 3.0. Regarding point number 3: I made a version conversion script for the NAN 1 -> 2 transition, which will warn about those APIs being removed, saying the code needs to be rewritten using |
The runtime flag makes switching to the new implementation transparent from both the JS and C++ side. As for the new Thanks for looking into (3). Nice to know that developers have generally stayed away from using that part of the V8 API directly. |
Question (forgive the incompetence): does this mean |
@brendanashworth It still uses |
Fixed by 65cd82a and subsequent commits. |
Creating this issue so the following can be discussed in the TC meeting:
Uint8Array
backedBuffer
can roll out on a minor release or only on a major.v8::Object::GetIndexedPropertiesExternalArrayData()
?new ArrayBuffer()
is limited to0x3fffffff
? (same as Buffer) If the memory is pre-allocated (which we will be doing) then there is no upper limit. This discrepancy only happens in 4.3. In 4.4 it's fixed so both APIs can be arbitrarily large.Persistent
's anymore. Will this affect anyone?The text was updated successfully, but these errors were encountered: