-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
r? @Manishearth |
// 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 { |
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.
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.
Well, bors doesn't peek inline comments. Feel free to r=me, or waiting for @Manishearth comments if any :) |
@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. |
📌 Commit 8f991f7 has been approved by |
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 -->
☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev |
This addresses the discussion in https://github.com/servo/servo/pull/12725/files/b916ad0a85b88eb40d919986cdc0c6b7420a4fab#r73459385
This change is