-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
src: remove unowned usages of GetBackingStore #44080
Conversation
This removes all usages of GetBackingStore without any entries in the `CODEOWNERS` file. For the most part this is a pretty straightforward review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`. See the linked issue for an explanation. Refs: nodejs#32226 Refs: nodejs#43921
cc @nodejs/buffer There are also the following related PRs, but I'm opting not to CC the group on all of them, since they already have codeowners: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} else if (args[0]->IsSharedArrayBuffer()) { | ||
source = args[2].As<SharedArrayBuffer>()->GetBackingStore(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nodejs/whatwg-stream: this is a typo: the first args[0]
should be args[2]
. I don't think it ends up being an issue in practice. The only user of copyArrayBuffer
is in lib/internal/webstreams/readablestream.js
, and it doesn't seem possible to pass in a SharedArrayBuffer
to either of its arguments.
Anyway, the code motion in this diff fixes the issue anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@kvakil FYI. Jenkins CI run has two modes: fresh build and Resume Build. Adding If Jenkins CI fails often(like in this pr), it would be better to let a collaborator trigger a resume build, instead of restarting a fresh test every time. In long term, we should solve those test flaky or test infra problems. So if you could help to take a look at those problems when ci flaky, it will be great. |
Landed in 8c35a4e |
@kvakil <https://github.com/kvakil> FYI. Jenkins CI run has two modes:
fresh build and Resume Build. Adding |request-ci| label will trigger a
fresh build, and everything will start fresh. Resume Build mode will
only retry the failed test which is more likely to hit a retry
success. But Resume Build mode could only be triggered by a
collaborator in Jenkins CI. see
https://github.com/nodejs/node/blob/main/doc/contributing/collaborator-guide.md#testing-and-ci
for more details.
Thanks, that's a good tip! I did not know about the Resume Build option.
|
This removes all usages of GetBackingStore without any entries in the `CODEOWNERS` file. For the most part this is a pretty straightforward review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`. See the linked issue for an explanation. Refs: #32226 Refs: #43921 PR-URL: #44080 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This removes all usages of GetBackingStore without any entries in the `CODEOWNERS` file. For the most part this is a pretty straightforward review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`. See the linked issue for an explanation. Refs: #32226 Refs: #43921 PR-URL: #44080 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
In an earlier PR, I replaced a lot of instances of `GetBackingStore()->Data()` with `Data()`. Apparently these two are not equivalent in the case of zero-length buffers: the former returns a "valid" address, while the latter returns `NULL`. At least one library in the ecosystem (see the referenced issue) abuses zero-length buffers to wrap arbitrary pointers, which is broken by this difference. It is unfortunate that every library needs to take a performance hit because of this edge-case, and somebody should figure out if this is actually a reasonable contract to uphold long-term. I have not traced down exactly why this divergence occurs, but I have verified that reverting this line fixes the referenced issue. Refs: nodejs#44080 Fixes: nodejs#44554
In an earlier PR, I replaced a lot of instances of `GetBackingStore()->Data()` with `Data()`. Apparently these two are not equivalent in the case of zero-length buffers: the former returns a "valid" address, while the latter returns `NULL`. At least one library in the ecosystem (see the referenced issue) abuses zero-length buffers to wrap arbitrary pointers, which is broken by this difference. It is unfortunate that every library needs to take a performance hit because of this edge-case, and somebody should figure out if this is actually a reasonable contract to uphold long-term. I have not traced down exactly why this divergence occurs, but I have verified that reverting this line fixes the referenced issue. Refs: nodejs#44080 Fixes: nodejs#44554
In an earlier PR, I replaced a lot of instances of `GetBackingStore()->Data()` with `Data()`. Apparently these two are not equivalent in the case of zero-length buffers: the former returns a "valid" address, while the latter returns `NULL`. At least one library in the ecosystem (see the referenced issue) abuses zero-length buffers to wrap arbitrary pointers, which is broken by this difference. It is unfortunate that every library needs to take a performance hit because of this edge-case, and somebody should figure out if this is actually a reasonable contract to uphold long-term. I have not traced down exactly why this divergence occurs, but I have verified that reverting this line fixes the referenced issue. Refs: nodejs#44080 Fixes: nodejs#44554
This removes all usages of GetBackingStore without any entries in the `CODEOWNERS` file. For the most part this is a pretty straightforward review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`. See the linked issue for an explanation. Refs: nodejs#32226 Refs: nodejs#43921 PR-URL: nodejs#44080 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This removes all usages of GetBackingStore without any entries in the
CODEOWNERS
file. For the most part this is a pretty straightforwardreview; except
SPREAD_BUFFER_ARG
and the changes toCopyArrayBuffer
.See the linked issue for an explanation.
Refs: #32226
Refs: #43921