mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Add refcount logging to servo_arc.
Differential Revision: https://phabricator.services.mozilla.com/D32173
This commit is contained in:
parent
57868f571f
commit
9a9a4e12d5
10 changed files with 100 additions and 23 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue