Skip to content
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

typedarray: Use a Cell for handling interior mutability. #408

Merged
merged 2 commits into from Mar 24, 2018
Merged

Conversation

@emilio
Copy link
Member

emilio commented Mar 24, 2018

The typed array wrapper has a "computed" option that uses to cache its data.

That means that you need a mutable reference to the typed array in order to read
it, which is not great.

In particular, it's plain impossible when the typed array is provided as a
member of a struct via WebIDL.

Use a Cell and expose to_vec and as_slice in non-mutable references.


This change is Reviewable

emilio added 2 commits Mar 24, 2018
The typed array wrapper has a "computed" option that uses to cache its data.

That means that you need a mutable reference to the typed array in order to read
it, which is not great.

In particular, it's plain impossible when the typed array is provided as a
member of a struct via WebIDL.

Use a `Cell` and expose to_vec and as_slice in non-mutable references.
I believe this is non-breaking.
@emilio
Copy link
Member Author

emilio commented Mar 24, 2018

r? @jdm

@jdm
Copy link
Member

jdm commented Mar 24, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

📌 Commit fbef376 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

Testing commit fbef376 with merge 8736791...

bors-servo added a commit that referenced this pull request Mar 24, 2018
typedarray: Use a Cell for handling interior mutability.

The typed array wrapper has a "computed" option that uses to cache its data.

That means that you need a mutable reference to the typed array in order to read
it, which is not great.

In particular, it's plain impossible when the typed array is provided as a
member of a struct via WebIDL.

Use a `Cell` and expose to_vec and as_slice in non-mutable references.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/408)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Mar 24, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: jdm
Pushing 8736791 to master...

@bors-servo bors-servo merged commit fbef376 into master Mar 24, 2018
5 checks passed
5 checks passed
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
homu Test successful
Details
bors-servo added a commit to servo/servo that referenced this pull request Mar 24, 2018
Update mozjs.

Peeks up servo/rust-mozjs#408.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20419)
<!-- Reviewable:end -->
bors-servo added a commit to servo/servo that referenced this pull request Mar 24, 2018
Update mozjs.

Peeks up servo/rust-mozjs#408.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20419)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 25, 2018
Peeks up servo/rust-mozjs#408.

Source-Repo: https://github.com/servo/servo
Source-Revision: b8279b376bb4b6118c5a65fa6aeaf5a08c6e953b

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : c9cece8149aa3005905cad7dd27a58a360e6cd35
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 2, 2019
Peeks up servo/rust-mozjs#408.

Source-Repo: https://github.com/servo/servo
Source-Revision: b8279b376bb4b6118c5a65fa6aeaf5a08c6e953b

UltraBlame original commit: 870708dc30ed7c76e8b7b0516ac51c9994d94389
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 2, 2019
Peeks up servo/rust-mozjs#408.

Source-Repo: https://github.com/servo/servo
Source-Revision: b8279b376bb4b6118c5a65fa6aeaf5a08c6e953b

UltraBlame original commit: 870708dc30ed7c76e8b7b0516ac51c9994d94389
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 2, 2019
Peeks up servo/rust-mozjs#408.

Source-Repo: https://github.com/servo/servo
Source-Revision: b8279b376bb4b6118c5a65fa6aeaf5a08c6e953b

UltraBlame original commit: 870708dc30ed7c76e8b7b0516ac51c9994d94389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.