style: Add support for static references to servo_arc::Arc. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D17186
This commit is contained in:
Cameron McCormack 2019-03-30 00:15:57 +00:00 committed by Emilio Cobos Álvarez
parent b71a601a36
commit f889b303da
2 changed files with 158 additions and 37 deletions

View file

@ -129,6 +129,9 @@ impl UserAgentCascadeDataCache {
}
fn expire_unused(&mut self) {
// is_unique() returns false for static references, but we never have
// static references to UserAgentCascadeDatas. If we did, it may not
// make sense to put them in the cache in the first place.
self.entries.retain(|e| !e.is_unique())
}