mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make DEBUG_ID_COUNTER a plain static.
Apparently it no longer needs to be static mut.
This commit is contained in:
parent
49aed6555d
commit
475c27e966
1 changed files with 2 additions and 3 deletions
|
@ -6,7 +6,6 @@
|
||||||
//! that can be viewed by an external tool to make layout debugging easier.
|
//! that can be viewed by an external tool to make layout debugging easier.
|
||||||
|
|
||||||
#![macro_use]
|
#![macro_use]
|
||||||
#![allow(unsafe_code)] // thread_local!() defines an unsafe function on Android
|
|
||||||
|
|
||||||
use flow_ref::FlowRef;
|
use flow_ref::FlowRef;
|
||||||
use flow;
|
use flow;
|
||||||
|
@ -20,7 +19,7 @@ use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
||||||
|
|
||||||
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
|
||||||
|
|
||||||
static mut DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
static DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||||
|
|
||||||
pub struct Scope;
|
pub struct Scope;
|
||||||
|
|
||||||
|
@ -98,7 +97,7 @@ impl Drop for Scope {
|
||||||
/// which are often reallocated but represent essentially the
|
/// which are often reallocated but represent essentially the
|
||||||
/// same data.
|
/// same data.
|
||||||
pub fn generate_unique_debug_id() -> u16 {
|
pub fn generate_unique_debug_id() -> u16 {
|
||||||
unsafe { DEBUG_ID_COUNTER.fetch_add(1, Ordering::SeqCst) as u16 }
|
DEBUG_ID_COUNTER.fetch_add(1, Ordering::SeqCst) as u16
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Begin a layout debug trace. If this has not been called,
|
/// Begin a layout debug trace. If this has not been called,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue