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

stylo: Use AtomicUsize to store our initial computed values #12750

Merged
merged 1 commit into from
Aug 6, 2016

Conversation

bholley
Copy link
Contributor

@bholley bholley commented Aug 5, 2016

@highfive
Copy link

highfive commented Aug 5, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 5, 2016
@bholley
Copy link
Contributor Author

bholley commented Aug 5, 2016

r? @Manishearth

@highfive highfive assigned Manishearth and unassigned nox Aug 5, 2016
@bholley bholley changed the title stylo: Use AtomicUsize to store our initial computed values. stylo: Use AtomicUsize to store our initial computed values Aug 5, 2016
// store them as AtomicPtr, but we can't have static AtomicPtr without const
// fns, which aren't in stable Rust.
static INITIAL_VALUES_STORAGE: AtomicUsize = ATOMIC_USIZE_INIT;
unsafe fn raw_initial_values() -> *mut ComputedValues {
Copy link
Member

@emilio emilio Aug 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still haven't found any reference to undefined behavior for doing what we were doing, but anyway, I've verified that using AtomicPtr with Ordering::Relaxed is only 1 instruction more in x86.

@emilio
Copy link
Member

emilio commented Aug 5, 2016

Well, bors doesn't peek inline comments. Feel free to r=me, or waiting for @Manishearth comments if any :)

@Manishearth
Copy link
Member

@bors-servo r+

I don't particularly like using atomicusize as a stand in for atomicptr, but AIUI they have the same semantics so it's fine.

@bors-servo
Copy link
Contributor

📌 Commit 8f991f7 has been approved by Manishearth

@bors-servo
Copy link
Contributor

⌛ Testing commit 8f991f7 with merge 84d2e59...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Aug 6, 2016
bors-servo pushed a commit that referenced this pull request Aug 6, 2016
stylo: Use AtomicUsize to store our initial computed values

This addresses the discussion in https://github.com/servo/servo/pull/12725/files/b916ad0a85b88eb40d919986cdc0c6b7420a4fab#r73459385

<!-- 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/12750)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo bors-servo merged commit 8f991f7 into servo:master Aug 6, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 6, 2016
@bholley bholley deleted the atomic_ptr branch August 26, 2016 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants