diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-27 14:16:05 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-27 14:16:05 +0200 |
commit | 378babfd4ce587295b826aea169327a2706095f4 (patch) | |
tree | f255aaaeb56654d0dd0f860829d653d495fe10a2 /components/script/dom/bindings/root.rs | |
parent | 8d566fbc3c1954b2da0b0e185e224d5bde99b8e3 (diff) | |
download | servo-378babfd4ce587295b826aea169327a2706095f4.tar.gz servo-378babfd4ce587295b826aea169327a2706095f4.zip |
Move STACK_ROOTS to dom::bindings::root
Diffstat (limited to 'components/script/dom/bindings/root.rs')
-rw-r--r-- | components/script/dom/bindings/root.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs index 9f10fc87f2a..ae81e4909b9 100644 --- a/components/script/dom/bindings/root.rs +++ b/components/script/dom/bindings/root.rs @@ -35,8 +35,7 @@ use js::jsapi::{JSObject, JSTracer, Heap}; use js::rust::GCMethods; use mitochondria::OnceCell; use script_layout_interface::TrustedNodeAddress; -use script_thread::STACK_ROOTS; -use std::cell::UnsafeCell; +use std::cell::{Cell, UnsafeCell}; use std::default::Default; use std::hash::{Hash, Hasher}; #[cfg(debug_assertions)] @@ -157,7 +156,7 @@ pub struct RootCollection { } /// A pointer to a RootCollection, for use in global variables. -pub struct RootCollectionPtr(pub *const RootCollection); +struct RootCollectionPtr(pub *const RootCollection); impl Copy for RootCollectionPtr {} impl Clone for RootCollectionPtr { @@ -166,6 +165,8 @@ impl Clone for RootCollectionPtr { } } +thread_local!(static STACK_ROOTS: Cell<Option<RootCollectionPtr>> = Cell::new(None)); + pub struct ThreadLocalStackRoots<'a>(PhantomData<&'a u32>); impl<'a> ThreadLocalStackRoots<'a> { |