util: Add format for SharedArrayBuffer#8587
util: Add format for SharedArrayBuffer#8587yosuke-furukawa wants to merge 1 commit intonodejs:masterfrom
Conversation
|
Shouldn't we wait for this feature to become publicly available in V8 first? |
lib/util.js
Outdated
There was a problem hiding this comment.
Just a suggestion but I think you can join this with the isArrayBuffer case using ||.
src/node_util.cc
Outdated
There was a problem hiding this comment.
Note: If you rebase against master, this one should already be in the list due to #8510. Feel free to sort that in alphabetically, though. :)
Well, we’ve already done this for SIMD, and I think it’s okay to be prepared for a release where SABs work without |
8bc1f65 to
4e4ab76
Compare
|
Thank you for your review, I fixed them. |
|
I think we should wait until we have a strategy related to SharedArrayBuffer first. @petkaantonov worked on a PR that would enable just that (using SharedArrayBuffer like that) but afaik it is stalled. |
lib/util.js
Outdated
There was a problem hiding this comment.
Worth updating this comment too to include reference to SharedArrayBuffer?
src/node_util.cc
Outdated
There was a problem hiding this comment.
Looks like this changes in this file can be removed (it's just moving the line).
There was a problem hiding this comment.
I just sort the line in alphabetical order.
There was a problem hiding this comment.
I don't know if there's a preference, but we can use eslints global comment to pacify too
/* global SharedArrayBuffer */
4e4ab76 to
e5c6df2
Compare
|
@benjamingr |
|
@yosuke-furukawa and what exactly would one do with a SharedArrayBuffer in Node? The underlying cluster implementation does not support it. |
|
@benjamingr Does that matter for this PR? The data structure is available in node (behind the v8 flag), and when used, the inspect output does not mirror that of the |
jasnell
left a comment
There was a problem hiding this comment.
I'm good with adding this now. LGTM
PR-URL: #8587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Landed in ce7d307. Thank you! |
PR-URL: #8587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: nodejs#8587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #8587 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
util
Description of change
SharedArrayBuffer is a new global object to share memories between workers.
Currently workers does not work in node, but future v8 has those new global objects.
This change supports a format for SharedArrayBuffer.
Note: this PR is from code-and-learn
nodejs/code-and-learn#56 (comment)