diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-05-16 04:35:34 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-06-04 01:03:53 -0400 |
commit | 9a9a4e12d51c983db25e3517332f3f7346ef7b22 (patch) | |
tree | b1f71b4f4fbc79a86dc7044dc6c8673f5ecce2bf /components/style/sharing/mod.rs | |
parent | 57868f571fa56df535e8f5df4aec511b93b55c9b (diff) | |
download | servo-9a9a4e12d51c983db25e3517332f3f7346ef7b22.tar.gz servo-9a9a4e12d51c983db25e3517332f3f7346ef7b22.zip |
style: Add refcount logging to servo_arc.
Differential Revision: https://phabricator.services.mozilla.com/D32173
Diffstat (limited to 'components/style/sharing/mod.rs')
-rw-r--r-- | components/style/sharing/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs index 3ce2a717dc8..5f5d1c6cab5 100644 --- a/components/style/sharing/mod.rs +++ b/components/style/sharing/mod.rs @@ -485,8 +485,12 @@ type SharingCache<E> = SharingCacheBase<StyleSharingCandidate<E>>; type TypelessSharingCache = SharingCacheBase<FakeCandidate>; type StoredSharingCache = Arc<AtomicRefCell<TypelessSharingCache>>; -thread_local!(static SHARING_CACHE_KEY: StoredSharingCache = - Arc::new(AtomicRefCell::new(TypelessSharingCache::default()))); +thread_local! { + // TODO(emilio): Looks like a few of these should just be Rc<RefCell<>> or + // something. No need for atomics in the thread-local code. + static SHARING_CACHE_KEY: StoredSharingCache = + Arc::new_leaked(AtomicRefCell::new(TypelessSharingCache::default())); +} /// An LRU cache of the last few nodes seen, so that we can aggressively try to /// reuse their styles. |